Origins clear a replacement for DES was needed

  • Slides: 26
Download presentation

Origins Ø clear a replacement for DES was needed l l Key size is

Origins Ø clear a replacement for DES was needed l l Key size is too small The variants are just patches Ø can use Triple-DES – but slow, has small blocks Ø US NIST issued call for ciphers in 1997 Ø 15 candidates accepted in Jun 98 Ø 5 were shortlisted in Aug-99

AES Competition Requirements Ø private key symmetric block cipher Ø 128 -bit data, 128/192/256

AES Competition Requirements Ø private key symmetric block cipher Ø 128 -bit data, 128/192/256 -bit keys Ø stronger & faster than Triple-DES Ø provide full specification & design details Ø both C & Java implementations Ø NIST have released all submissions & unclassified analyses

AES Evaluation Criteria Ø initial criteria: l l l security – effort for practical

AES Evaluation Criteria Ø initial criteria: l l l security – effort for practical cryptanalysis cost – in terms of computational efficiency algorithm & implementation characteristics Ø final criteria l l general security ease of software & hardware implementation attacks flexibility (in en/decrypt, keying, other factors)

AES Shortlist Ø after testing and evaluation, shortlist in Aug-99: l l l Ø

AES Shortlist Ø after testing and evaluation, shortlist in Aug-99: l l l Ø Ø MARS (IBM) - complex, fast, high security margin RC 6 (USA) - v. simple, v. fast, low security margin Rijndael (Belgium) - clean, fast, good security margin Serpent (Euro) - slow, clean, v. high security margin Twofish (USA) - complex, v. fast, high security margin then subject to further analysis & comment saw contrast between algorithms with l l few complex rounds versus many simple rounds Refined versions of existing ciphers versus new proposals

The AES Cipher - Rijndael was selected as the AES in Oct-2000 Ø issued

The AES Cipher - Rijndael was selected as the AES in Oct-2000 Ø issued as FIPS PUB 197 standard in Nov-2001 Ø designed by Joan Rijmen and Vincent. Daemen in Belgium Ø has 128/192/256 bit keys, 128 bit data Ø an iterative rather than Feistel cipher Ø l l Ø processes data as block of 4 columns of 4 bytes operates on entire data block in every round designed to be: l l l resistant against known attacks speed and code compactness on many CPUs design simplicity

Rijndael data block viewed as 4 -by-4 table of bytes Ø Such a table

Rijndael data block viewed as 4 -by-4 table of bytes Ø Such a table is called the current state Ø key is expanded to array of words Ø has 10 rounds in which state the following transformations (called `layers’): Ø l l Ø BS- byte substitution (1 S-box used on every byte) SR- shift rows (permute bytes between groups/columns) MC- mix columns (uses matrix multiplication in GF(256)) ARK- add round key (XOR state with round key) First and last round are a little different

Rijndael

Rijndael

Byte Substitution a simple substitution of each byte Ø uses one S-box of 16

Byte Substitution a simple substitution of each byte Ø uses one S-box of 16 x 16 bytes containing a permutation of all 256 8 -bit values Ø each byte of state is replaced by byte indexed by row (left 4 -bits) & column (right 4 -bits) Ø l l eg. byte {95} is replaced by byte in row 9 column 5 which has value {2 A} S-box constructed using defined transformation of values in GF(256) Ø S-box constructed using a simple math formula using a non-linear function : 1/x. Ø Construction of S-Box (on board) Ø

Byte Substitution

Byte Substitution

Shift Rows Ø a circular byte shift in each l l 1 st row

Shift Rows Ø a circular byte shift in each l l 1 st row is unchanged 2 nd row does 1 byte circular shift to left 3 rd row does 2 byte circular shift to left 4 th row does 3 byte circular shift to left decrypt inverts using shifts to right Ø since state is processed by columns, this step permutes bytes between the columns Ø

Shift Rows

Shift Rows

Mix Columns Ø each column is processed separately Ø each byte is replaced by

Mix Columns Ø each column is processed separately Ø each byte is replaced by a value dependent on all 4 bytes in the column Ø effectively a matrix multiplication in GF(28) using prime poly m(x) =x 8+x 4+x 3+x+1

Mix Columns

Mix Columns

Mix Columns Ø can express each col of the new state as 4 equations

Mix Columns Ø can express each col of the new state as 4 equations l Ø decryption requires use of inverse matrix l Ø One equation to derive each new byte in col with larger coefficients, hence a little harder have an alternate characterization l l l each column a 4 -term polynomial with coefficients in GF(28) and polynomials multiplied modulo (x 4+1)

Add Round Key Ø XOR state with 128 -bits of the round key Ø

Add Round Key Ø XOR state with 128 -bits of the round key Ø again processed by column (though effectively a series of byte operations) Ø inverse for decryption identical l since XOR own inverse, with reversed keys Ø designed to be as simple as possible

Add Round Key

Add Round Key

AES Round

AES Round

AES Key Scheduling Ø takes 128 -bit (16 -byte) key and expands into array

AES Key Scheduling Ø takes 128 -bit (16 -byte) key and expands into array of 44 32 -bit words l see the equations (on board)

AES Key Expansion

AES Key Expansion

Key Expansion Rationale Ø designed to resist known attacks Ø design criteria included l

Key Expansion Rationale Ø designed to resist known attacks Ø design criteria included l l l l knowing part key insufficient to find many more invertible transformation fast on wide range of CPU’s use round constants to break symmetry diffuse key bits into round keys enough non-linearity to hinder analysis simplicity of description

AES Decryption Ø AES decryption is not identical to encryption since steps done in

AES Decryption Ø AES decryption is not identical to encryption since steps done in reverse Ø but can define an equivalent inverse cipher with steps as for encryption l l but using inverses of each step with a different key schedule Ø works since result is unchanged when l l swap byte substitution & shift rows swap mix columns & add (tweaked) round key

AES Decryption

AES Decryption

Implementation Aspects Ø can efficiently implement on 8 -bit CPU l l byte substitution

Implementation Aspects Ø can efficiently implement on 8 -bit CPU l l byte substitution works on bytes using a table of 256 entries shift rows is simple byte shift add round key works on byte XOR’s mix columns requires matrix multiply in GF(28) which works on byte values, can be simplified to use table lookups & byte XOR’s

AES- Design considerations Not a Feistel scheme: so diffusion is faster, but it’s a

AES- Design considerations Not a Feistel scheme: so diffusion is faster, but it’s a new scheme, so less analyzed Ø S-box: mathematically construction, no debate; based on the x x^(-1) transformation Ø Shift row- to resist two recent attacke: truncated differential and the square attack Ø Key scheduling – nonlinear (uses the S-box) mixing of the key bits Ø 10 rounds; there attacks better than brutesearch for Rijndael-with-7 -rounds, so extra 3 rounds for safety. Ø

Implementation Aspects Our description assumed 8 -bit operations Ø AES can be efficiently implemented

Implementation Aspects Our description assumed 8 -bit operations Ø AES can be efficiently implemented on 32 -bit CPU Ø l l redefine steps to use 32 -bit word operations can precompute some tables then each column in each round can be computed using table lookups + 4 XORs at a cost of 4 Kb to store tables very efficient; Ø implementation was a key factor in its selection as the AES cipher Ø Ø AES animation: http: //www. cs. bc. edu/~straubin/cs 38105/blockciphers/rijndael_ingles 2004. swf