Cryptography Reference
In-Depth Information
E XAMPLE . For simplicity's sake, we'll do an example of CBC using a simple shift Vigenere
cipher with a block size of one byte. Since we are using a bitwise operation (namely, exclu-
sive-or), we will be mapping bytes. Some numbers will be in base 2.
The plaintext message is
p = I LOVE YOU = [73, 76, 79, 86, 69, 89, 79, 85] = [01001001, 01001100, 01001111,
01010110, 01000101, 01011001, 01001111, 01010101].
(The last quantity is the binary representation.) The key is
= CROAK = [67, 82, 79, 65, 75] =
[01000011, 01010010, 01001111, 01000001, 01001011],
k
and the initialization vector is one byte long, given in binary by
iv = 10110010.
(Throughout the rest of this example, all numbers will be represented in binary.) The first
ciphertext block is enciphered as
c 1 = E ( p 1 iv)
=
E
(01001001
10110010)
=
E
(11111011)
11111011 + 01000011 (mod 100000000)
00111110 (mod 100000000)
where we represent the enciphering transformation as
. The resulting ciphertext block is
used as input for enciphering the next ciphertext block. This yields
E
c 2
= E ( p 2 c 1 )
=
E
(01001100
00111110)
E
=
(01110010)
01110010 + 01010010 (mod 100000000)
11000100 (mod 100000000).
The enciphering continues, with each block's value dependent on the previous ciphertext
block.
c 3 = 11011010
c 4 = 11001101
c 5 = 11010011
c 6 = 11001101
c 7 = 11010100
c 8 = 11010000
Search WWH ::




Custom Search