Lab 6
AES
The Advanced Encryption Standard (AES) AES is a symmetric block cipher that is Input(128 bit key and message)
was published by the National Institute of intended to replace DES as the approved
Standards and Technology (NIST) in 2001. standard for a wide range of applications.
o Key =Thats my Kung Fu (16 ASCII characters, 1byte each)
o Key in Hex(128bits):54 68 61 74 73 20 6D 79 20 4B 75 6E 67 20 46 75
o (32 Hex characters) (space) → 20
❑ w[0]=(54,68,61,74)
❑ w[1]= (73,20,6D,79)
❑ w[2]= (20,4B,75,6E)
❑ w[3]= (67,20,46,75)
❑ g(w[3])
Key : 54 68 61 74 73 20 6D 79 20 4B 75 6E 67 20 46 75
❑ Function g
❑ w[3]= (67,20,46,75)
❑ g(w[3])
1) Circular byte left shift of w[3]:(20,46,75,67)
2) Byte Substitution (S-Box):(B7,5A,9D,85)
3) Xor round constant (01,00,00,00)
✓ The round constant is a word in which the three rightmost bytes
are always 01.B7=> 0000 0001 xor 1011 0111=> 1011 0110 =>B6
• gives: g(w[3])= (B6,5A,9D,85)
❑ S-Box
❑ Round Constant RC[j]
❑ j=Round iteration
❑ w[0]= (54,68,61,74)
❑ g(w[3])=(B6,5A,9D,85)
❑ w[4]=w[0] ⊕ g(w[3]) =(E2,32,FC,F1)
❑ w[5]=w[4]⊕w[1]= (91,12,91,88)
❑ w[6]=w[5]⊕w[2]= (B1,59,E4,E6)
❑ w[7]=w[6]⊕w[3]= (D6,79,A2,93)
❑ First round key :E232FCF1 91129188 B159E4E6 D679A293
❑ Round0:5468617473206D79204B756E67204675
❑ Round1:E232FCF191129188B159E4E6D679A293
❑ Round2:56082007C71AB18F76435569A03AF7FA
❑ Round3:D2600DE7157ABC686339E901C3031EFB
❑ Round4:A11202C9B468BEA1D75157A01452495B
❑ Round5:B1293B3305418592D210D232C6429B69
❑ Round6:BD3DC2B7B87C47156A6C9527AC2E0E4E
❑ Round7:CC96ED1674EAAA031E863F24B2A8316A
❑ Round8:8E51EF21FABB4522E43D7A0656954B6C
❑ Round9:BFE2BF904559FAB2A16480B4F7F1CBD8
❑ Round10:28FDDEF86DA4244ACCC0A4FE3B316F26
❑ Plain text in English :Two One Nine Two ( 16 ASCII characters)
❑ Plain text in Hex (128bits) : 54 77 6F 20 4F 6E 65 20 4E 69 6E 65 20 54
77 6F
❑ Add Round key, Round 0
❑ M =54 77 6F 20 4F 6E 65 20 4E 69 6E 65 20 54 77 6F
❑ 𝑅0 =54 68 61 74 73 20 6D 79 20 4B 75 6E 67 20 46 75
❑ XOR the corresponding entries, e.g., 69 ⊕ 4B =22
⊕ =
❑ Round1:
❑ AES Encryption Round
❑ S-Box
❑ Byte 6E is
substituted by
entry of S-Box
in Row 6 And
column E
,i.e. by 9F
❑ Substitution transformation
1) Round1,Substitution Bytes:
❑ Current State Matrix New State Matrix
❑ This non linear layer is for resistance to differential and linear
cryptanalysisattacks
❑ AES Encryption Round
❑ Shift row transformation
2) Round1,Shift Row:
❑ Current State Matrix New State Matrix
❑ This linear mixing step causes diffusion of the bits over multiple rounds
❑ AES Encryption Round
❑ Mix column transformation
3) Round1, Mix Column
❑ Current State Matrix New State Matrix
❑ Round1, Mix Column
❑ Entry BA is result of (02• 63)⊕(03•2F)⊕(01•AF) ⊕(01•A2)
❑ 02•63=00000010•01100011=11000110 (shift left)
❑ 03•2F=(02•2F)⊕2F=
⊕
(00000010•00101111)⊕00101111=01110001
❑ 01•AF =AF =10101111
❑ 01•A2 =A2 =10100010
❑ Round1, Mix Column
❑ 02•63=00000010•01100011=11000110 (shift left)
❑ 02•F2 = 0000 0010•1111 0010 = 1110 0100 ⊕1B=
1110 0100 ⊕ 0001 1011= 1111 1111
❑ 02 • 87 = 0000 0010•1000 1110 = 0001 1100 ⊕ 0001 1011 =
0001 0111
Solve : 02 • D4 , 03 • BF
❑ AES Encryption Round
4) Round 1 , Add Round key
❑ Round1:E2 32 FC F1 91 12 91 88 B1 59 E4 E6 D6 79 A2 93
❑ Current State Matrix Round1 New State Matrix
⊕ =
❑ Round 2
❑ Round 9
❑ Round 10
❑ ciphertext:29 C3 50 5F 57 14 20 F6 40 22 99 B3 1A 02 D7 3A
DES AES
Date 1977 2001
Block Size 64 128
Key Size 56 128, 192, 256
Number of Rounds 16 10, 11, 13
Design open Open
Encryption primitives Substitution, Permutation Substitution, Shift, Mixing
Cryptographic primitives Confusion, diffusion Confusion, diffusion
Thank you