Cryptography: A Very Short Introduction by Fred Piper & Sean Murphy

Cryptography: A Very Short Introduction by Fred Piper & Sean Murphy

Author:Fred Piper & Sean Murphy
Language: eng
Format: epub
Publisher: OUP Oxford
Published: 2002-06-15T04:00:00+00:00


A block cipher in ECB mode

Suppose that an unknown block cipher with an unknown key is used to encrypt the message ‘The price is four thousand pounds’. All that is known is that a message block consists of two letters, that punctuation, spaces, etc., are ignored, and the cryptogram is:

c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14

Suppose that an attacker knows the message. Then they are able to work out that c1 represents Th, c2 represents ep, etc. They can then manipulate the cryptogram so that only c1, c2, c3, c4, c5, c6, c7, c12, c13, c14 is received. The receiver applies the decryption algorithm with the correct key to the received cryptogram to obtain ‘The price is four pounds’. Since the decryption worked and the message makes sense, the receiver has no reason to suspect that the cryptogram has been manipulated and assumes that the price is correct.

Each of these potential dangers of using a block cipher in ECB mode can be removed by arranging for the encryption of each individual block to depend on all the message blocks that precede it in the message. If this is done, then identical message blocks almost certainly give distinct cryptogram blocks, and manipulation of the cryptogram is likely to result in meaningless messages after decryption has been applied. There are two standard ways of effecting this. They are known as Cipher Feedback (CFB) mode and Cipher Block Chaining (CBC) mode and are discussed later.

In order to illustrate how block ciphers are used in ECB mode we include a small example. The algorithm used is, of necessity, weak. In our example, the plaintext blocks, ciphertext blocks and keys are all of size 4 bits, and we use the HEX notation to describe them. For any given key K, the ciphertext block C corresponding to plaintext block M is obtained by XORing M with K and then rotating the bits of M K one position to the left.

We encrypt the plaintext bit string 10100010001110101001, which becomes A23A9 when HEX notation is used with key K = B. The process is as follows:

Remember that we are using the HEX notation, so for the first block M = 1010 and K = 1011. Thus M K = 0001. If we now perform the rotation we see that the ciphertext block is 0010, which is 2 in HEX.

Similarly for the second block if M = 2 and K = B. Thus M = 0010, K = 1011 and so M K = 1001. If we now perform the rotation on 1001 we see that the ciphertext block is 3 in HEX.

Repeating this type of calculation we see that if the message is A23A9 and we use our cipher in ECB mode with K = B then the cryptogram is 23124.

The obvious observation is that the repeated block of the message results in a repeated block in the cryptogram.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.