11.07.2015 Views

Cryptography - Sage

Cryptography - Sage

Cryptography - Sage

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The Advanced Encryption Standard allows Rijndael with key lengths 128, 192, or 256 bits.The eight-bit byte blocks which form the matrix entries are interpreted as elements ofthe finite field of 2 8 = 256 elements. The finite field is represented by the quotient ringF 2 8 = F 2 [X]/(X 8 + X 4 + X 3 + X + 1),whose elements are polynomials c 7 X 7 + c 6 X 6 + c 5 X 5 + c 4 X 4 + c 3 X 3 + c 2 X 2 + c 1 X + c 0 .We denote by BS, SR, MC, and ARK these four basic steps. There exist correspondinginverse operations IBS, ISR, IMC, IARK. The flow of the algorithms for enciphering anddeciphering are as follows:1. ARK2. BS, SR, MC, ARK.3. BS, SR, MC, ARK4. BS, SR, ARK1. ARK2. IBS, ISR, IMC, IARK.3. IBS, ISR, IMC, IARK4. IBS, ISR, ARKByteSub. The ByteSub operation is given by the S-box look-up table. Alternatively theS-box has a description in terms of the structure of the finite fields and linear algebra. Letx ′ be the inverse of x in F 2 8 if x ≠ 0 and set x ′ = x = 0 otherwise. Then the ByteSub stepis given by x ↦→ X 6 + X 5 + X + 1 + x ′ A where A is the matrix:⎛⎞1 1 1 1 1 0 0 00 1 1 1 1 1 0 00 0 1 1 1 1 1 0A =0 0 0 1 1 1 1 11 0 0 0 1 1 1 1⎜ 1 1 0 0 0 1 1 1⎟⎝ 1 1 1 0 0 0 1 1 ⎠1 1 1 1 0 0 0 15.4 Modes of OperationBlock ciphers can be applied to longer ciphertexts using one of various modes of operation.We assume that the input is plaintext M = M 1 M 2 . . ., the block enciphering map for givenkey K is E K , and the output is C = C 1 C 2 . . .. The possible block cipher modes of operationwhich we treat are identified by the acronyms ECB, CBC, CFB, and OFB. In each case weassume that we have a cipher of block length n, with enciphering maps E K and decipheringmaps D K for each key K.5.4. Modes of Operation 41

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

Saved successfully!

Ooh no, something went wrong!