1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester...

25
1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009

Transcript of 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester...

Page 1: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

1

University of Palestine

Information Security PrinciplesITGD 2202

Ms. Eman Alajrami

2nd Semester 2008-2009

Page 2: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

2

Chapter 5 –Advanced Encryption Standard

"It seems very simple.""It is very simple. But if you don't know what

the key is it's virtually indecipherable."—Talking to Strange Men, Ruth Rendell

Page 3: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

3

Originsclear a replacement for DES was needed

have theoretical attacks that can break ithave demonstrated exhaustive key search attacks

can use Triple-DES – but slow, has small blocksUS NIST issued call for ciphers in 199715 candidates accepted in Jun 98 5 were shortlisted in Aug-99 Rijndael was selected as the AES in Oct-2000issued as FIPS PUB 197 standard in Nov-2001

Page 4: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

4

AES Requirementsprivate key symmetric block cipher 128-bit data, 128/192/256-bit keys stronger & faster than Triple-DES active life of 20-30 years (+ archival use) provide full specification & design details both C & Java implementationsNIST have released all submissions &

unclassified analyses

Page 5: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

5

The AES Cipher - Rijndael designed by Rijmen-Daemen in Belgium has 128/192/256 bit keys, 128 bit data an iterative rather than feistel cipher

processes data as block of 4 columns of 4 bytesoperates on entire data block in every round

designed to be:resistant against known attacksspeed and code compactness on many CPUsdesign simplicity

Page 6: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

6

Rijndaeldata block of 4 columns of 4 bytes is statekey is expanded to array of wordshas 9/11/13 rounds in which state undergoes:

byte substitution (1 S-box used on every byte) shift rows (permute bytes between groups/columns) mix columns (subs using matrix multipy of groups) add round key (XOR state with key material)view as alternating XOR key & scramble data bytes

initial XOR key material & incomplete last roundwith fast XOR & table lookup implementation

Page 7: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

7

Rijndael

Page 8: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

8

Byte Substitutiona simple substitution of each byteuses one table of 16x16 bytes containing a

permutation of all 256 8-bit valueseach byte of state is replaced by byte indexed by row

(left 4-bits) & column (right 4-bits)eg. byte {95} is replaced by byte in row 9 column 5which has value {2A}

S-box constructed using defined transformation of values in GF(28)

designed to be resistant to all known attacks

Page 9: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

9

Byte Substitution

Page 10: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

10

Shift Rowsa circular byte shift in each each

1st row is unchanged2nd row does 1 byte circular shift to left3rd row does 2 byte circular shift to left4th row does 3 byte circular shift to left

decrypt inverts using shifts to rightsince state is processed by columns, this step

permutes bytes between the columns

Page 11: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

11

Shift Rows

Page 12: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

12

Mix Columnseach column is processed separatelyeach byte is replaced by a value dependent

on all 4 bytes in the columneffectively a matrix multiplication in GF(28)

using prime poly m(x) =x8+x4+x3+x+1

Page 13: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

13

Mix Columns

Page 14: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

14

Mix Columnscan express each col as 4 equations

to derive each new byte in coldecryption requires use of inverse matrix

with larger coefficients, hence a little harderhave an alternate characterisation

each column a 4-term polynomialwith coefficients in GF(28) and polynomials multiplied modulo (x4+1)

Page 15: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

15

Add Round KeyXOR state with 128-bits of the round keyagain processed by column (though

effectively a series of byte operations)inverse for decryption identical

since XOR own inverse, with reversed keysdesigned to be as simple as possible

a form of Vernam cipher on expanded keyrequires other stages for complexity / security

Page 16: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

16

Add Round Key

Page 17: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

17

AES Round

Page 18: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

18

AES Key Expansiontakes 128-bit (16-byte) key and expands into

array of 44/52/60 32-bit wordsstart by copying key into first 4 wordsthen loop creating words that depend on

values in previous & 4 places backin 3 of 4 cases just XOR these together1st word in 4 has rotate + S-box + XOR round

constant on previous, before XOR 4th back

Page 19: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

19

AES Key Expansion

Page 20: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

20

Key Expansion Rationaledesigned to resist known attacksdesign criteria included

knowing part key insufficient to find many moreinvertible transformationfast on wide range of CPU’suse round constants to break symmetrydiffuse key bits into round keysenough non-linearity to hinder analysissimplicity of description

Page 21: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

21

AES DecryptionAES decryption is not identical to encryption

since steps done in reversebut can define an equivalent inverse cipher

with steps as for encryptionbut using inverses of each stepwith a different key schedule

works since result is unchanged whenswap byte substitution & shift rowsswap mix columns & add (tweaked) round key

Page 22: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

22

AES Decryption

Page 23: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

23

Implementation Aspectscan efficiently implement on 8-bit CPU

byte substitution works on bytes using a table of 256 entries

shift rows is simple byte shiftadd round key works on byte XOR’smix columns requires matrix multiply in GF(28)

which works on byte values, can be simplified to use table lookups & byte XOR’s

Page 24: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

24

Implementation Aspectscan efficiently implement on 32-bit CPU

redefine steps to use 32-bit wordscan precompute 4 tables of 256-wordsthen each column in each round can be

computed using 4 table lookups + 4 XORsat a cost of 4Kb to store tables

designers believe this very efficient implementation was a key factor in its selection as the AES cipher

Page 25: 1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester 2008-2009.

25

Summaryhave considered:

the AES selection processthe details of Rijndael – the AES cipherlooked at the steps in each roundthe key expansionimplementation aspects