11.07.2015 Views

Cryptography - Sage

Cryptography - Sage

Cryptography - Sage

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

We do this by first verifying the equality∞∑n=012 + ∑ ∞ nn=1n2 = 2 ∑ ∞ ntogether with the standard identity ∑ ∞n=0 1/2n = 2.n=1n2 n ,Block CiphersWe summarise the modes of operation covered in this chapter.Electronic Codebook Mode. For a fixed key K, the output ciphertext is given byC j = E K (M j ) with output C 1 C 2 . . . .Ciphertext Block Chaining Mode. For input key K, and initialization vector IV = C 0 ,the output ciphertext is given by C j = E K (C j−1 ⊕ M j ), with output C 0 C 1 C 2 . . ..Ciphertext Feedback Mode. Given plaintext M 1 M 2 . . . in r-bit blocks, a key K, ann-bit cipher E K , and an n-bit initialization vector IV = I 1 , the ciphertext is computed as:C j = M j ⊕ L r (E K (I j ))I j+1 = R n−r (I j ) || C jwhere R n−r and L r are the operators which take the right-most n−r bits and the left-mostr bits, respectively, and || is concatenation.Output Feedback Mode. Given plaintext M 1 M 2 . . . in r-bit blocks, a key K, an n-bitcipher E K , and an n-bit initialization vector IV = I 0 , the ciphertext is computed as:I j = E K (I j−1 )C j = M j ⊕ L r (I j ),where L r is the operator which takes the left-most r bits.Exercise 5.1 What mode of operation has been used in the assignment and in class up tothis point, and why? What are the security disadvantages of this mode of operation?Solution. Electronic codebook mode – it leaves the cipher most open to analysis of itsstatistical properties, so that we can demonstrate the methods to crack it. It is also themost natural and naïve way to apply a block cipher.Exercise 5.2 Let E K be the 4-bit cipher defined by:⎛⎞1 0 0 1E K (M) = (K ⊕ M) ⎜ 0 1 1 0⎟⎝ 1 0 1 0 ⎠ = (X 1 + X 3 , X 2 + X 4 , X 2 + X 3 , X 1 + X 4 )0 1 0 1114 Appendix C. Solutions to Exercises

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!