0% ont trouvé ce document utile (0 vote)
827 vues5 pages

AES Algorithm Examples

Le document contient trois exemples sur l'Advanced Encryption Standard (AES) montrant le choix de clairs et de clés de 128 bits, la transformation pré-ronde et le décalage de rangée, ainsi que des opérations arithmétiques sur les corps finis comme le XOR et la multiplication.

Transféré par

Momina Shakoor
Copyright
© © All Rights Reserved
Nous prenons très au sérieux les droits relatifs au contenu. Si vous pensez qu’il s’agit de votre contenu, signalez une atteinte au droit d’auteur ici.
Formats disponibles
Téléchargez aux formats PDF, TXT ou lisez en ligne sur Scribd
0% ont trouvé ce document utile (0 vote)
827 vues5 pages

AES Algorithm Examples

Le document contient trois exemples sur l'Advanced Encryption Standard (AES) montrant le choix de clairs et de clés de 128 bits, la transformation pré-ronde et le décalage de rangée, ainsi que des opérations arithmétiques sur les corps finis comme le XOR et la multiplication.

Transféré par

Momina Shakoor
Copyright
© © All Rights Reserved
Nous prenons très au sérieux les droits relatifs au contenu. Si vous pensez qu’il s’agit de votre contenu, signalez une atteinte au droit d’auteur ici.
Formats disponibles
Téléchargez aux formats PDF, TXT ou lisez en ligne sur Scribd

Examples

Advanced Encryption Standard (AES)

Example 1
Choose 128-bit plaintext.
Each student will choose his/her 128 bits like 10101011110 …… 001
Prepare a State Matrix from these 128 bits

Solution for Example 1


Plaintext (128 bits):

0110 0101 0010 0000 0100 1110 0110 1001 0110 1110 0110 0101 0010 0000 0101 0100
0111 0111 1111 0110 0111 1000 0100 0101 0010 0000 1111 0100 0110 1110 0110 1111

In Hexadecimal
6 5 2 0 4 E 6 9 6 E 6 5 2 0 5 4
0110 0101 0010 0000 0100 1110 0110 1001 0110 1110 0110 0101 0010 0000 0101 0100

7 7 F 6 7 8 4 5 2 0 F 4 6 E 6 F
0111 0111 1111 0110 0111 1000 0100 0101 0010 0000 1111 0100 0110 1110 0110 1111

So,
State Matrix:
65 6E 77 20
20 65 F6 F4
4E 20 78 6E
69 54 45 6F
Example 2
Choose 128-bit plaintext.
Choose 128-bit key.

Each student will choose his/her 128 bits like 10101011110 …… 001
1) Perform pre-round transformation.
2) Then, perform Row Shift operation.

Solution for Example 2


Plaintext (128 bits):
****************
0110 0101 0010 0000 0100 1110 0110 1001 0110 1110 0110 0101 0010 0000 0101 0100
0111 0111 1111 0110 0111 1000 0100 0101 0010 0000 1111 0100 0110 1110 0110 1111

Plaintext in Hexadecimal :
6 5 2 0 4 E 6 9 6 E 6 5 2 0 5 4
0110 0101 0010 0000 0100 1110 0110 1001 0110 1110 0110 0101 0010 0000 0101 0100

7 7 F 6 7 8 4 5 2 0 F 4 6 E 6 F
0111 0111 1111 0110 0111 1000 0100 0101 0010 0000 1111 0100 0110 1110 0110 1111

So, State Matrix:


65 6E 77 20
20 65 F6 F4
4E 20 78 6E
69 54 45 6F

Key (128 bits):


************
0110 0111 0010 0000 0100 0110 0111 0101 0100 0101 0110 1000 0110 1001 0111 0011
0011 0011 0010 0000 0100 1101 0111 1001 0011 0000 0100 1011 0111 0101 0110 1110

Key in Hexadecimal :
6 7 2 0 4 6 7 5 4 5 6 8 6 9 7 3
0110 0111 0010 0000 0100 0110 0111 0101 0100 0101 0110 1000 0110 1001 0111 0011

3 3 2 0 4 D 7 9 3 0 4 B 7 5 6 E
0011 0011 0010 0000 0100 1101 0111 1001 0011 0000 0100 1011 0111 0101 0110 1110
So, Key Matrix:
67 45 33 30
20 68 20 4B
46 69 4D 75
75 73 79 6E

1) Pre round Transformation:


State Matrix XOR Key Matrix
65 6E 77 20 67 45 33 30
20 65 F6 F4 20 68 20 4B
4E 20 78 6E XOR 46 69 4D 75
69 54 45 6F 75 73 79 6E

=
02 2D 44 01
00 0D D6 DF
08 49 35 1B
1C 27 3C 01

2) Row Shift:

02 2D 44 01
0D D6 DF 00
35 1B 08 49
01 1C 27 3C
Example 3
Use Finite Field Arithmetic to solve this question.

1) 6D XOR 9E =

Solution :
6 D XOR 9 E
0110 1101 1001 1110

AFTER XOR
11110011 = F3 (IN HEXA)

-------------------------------------------------------------

2) ( 3C ) x ( D5 ) =

Solution :
3 C x D 5
0011 1100 1101 0101

(x5 + x4 +x3 +x2) x (x7+x6+x4+x2+1)


x7+x6+x4+x2+1
x5 + x4 +x3 +x2
----------------------------------------------------------
X12 + X11 +X9 + X7 +X5
+X11 + X10 +X8 +X6 +X4
+ X 10
+X9 +X7 +X5 +X3
+X9 +X8 +X6 +X4 +X2

(X12 + X3 + X2)
3) Calculate Multiplicative Inverse of 3D w.r.t BB

3 D B B
0011 1101 1011 1011
IN POLYNOMIAL
(x5 +x4+x3+x2+1) w.r.t (x7+x5+x4+x3+x+1)
Remainder Quotient Auxiliary
7 5 4 3
X +X +X +X +X+1 - 0
5 4 3
X +X +X +X +1 2 - 1
X 3 X2 + X + 1 X2 + X + 1
X2 + 1 X2 + X + 1 X4 + X2
X X X5 + X3 + X2 + X + 1
1 X X6 + X3 + X

THE ANSWER IS
X^6 + X^3 + X = 0100 1010 = 4A

Vous aimerez peut-être aussi