Q.1
14 MarksAlso asked in Summer 2024 Q1a
An active attack changes the data stream or creates a false one. Three active attacks are:
- Masquerade: one entity pretends to be another. For example, an attacker uses a stolen login to act as a bank customer.
- Replay: the attacker captures a valid message and sends it again later to get an unauthorised effect, for example to repeat a payment.
- Modification of messages: the attacker changes a part of a real message, or delays or reorders it. For example, "pay Rs 100 to A" becomes "pay Rs 900 to B".
A fourth active attack is denial of service, which stops the normal use of a service.
The Hill cipher encrypts letters at a time with an key matrix : . The key matrix must be invertible modulo 26.
Strengths
- It hides single-letter frequencies. With , the same letter can be encrypted to different letters, so simple frequency counting fails.
- A larger hides more of the structure of the language, and it is hard to break with ciphertext alone.
Weaknesses
- It is linear. If an attacker knows pairs of plaintext and ciphertext blocks, the key can be found by . So it falls to a known-plaintext attack.
- The same plaintext block always gives the same ciphertext block, so patterns remain.
So the Hill cipher is secure against ciphertext-only attack, but it is weak against known-plaintext attack.
Compare Counter and Cipher Block Chaining mode of operation used for encryption and decryption.
Both are modes of operation of a block cipher with key .
CBC (Cipher Block Chaining): each plaintext block is XORed with the previous ciphertext block before encryption. The first block uses a random initialisation vector (IV). Because of the chaining, two equal plaintext blocks give different ciphertext blocks, so patterns are hidden. The message must be padded to a whole number of blocks.
CTR (Counter): a counter value is encrypted, and the result is XORed with the plaintext block. The counter is different for every block, for example it is increased by 1. So the block cipher works like a stream cipher, and the plaintext may be of any length.
Comparison
| Point | CBC | CTR |
|---|---|---|
| Chaining | Each block depends on the previous ciphertext | Blocks are independent |
| Needs | An initialisation vector (IV) | A counter, different for every block |
| Parallel work | Encryption is sequential, decryption is parallel | Both are parallel |
| Decryption function | Needed | Not needed, only is used |
| Padding | Needed for the last block | Not needed |
| Random access | Not possible for encryption | Any block can be processed alone |
| Pre-computation | Not possible | The keystream can be computed in advance |
| Bit error in ciphertext | Spoils one block and flips a bit of the next | Spoils only that bit |
| Main risk | A predictable IV | Reusing a counter value with the same key |
CTR is faster and simpler. CBC is older and widely supported.
CBC chains the blocks and needs padding and an IV, while CTR makes a keystream from a counter and is parallel and needs no padding.