Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

Advanced Symmetric Cryptography

Chapter 03
Contents

 Advanced Encryption Standard (AES)


 Byte Substitution
 Shift Rows
 Mix Columns
 Add Round Key
 Sub-key Generation

2
Advanced Encryption Standard (AES)

 DES is not secure, 3DES is slow to execute => need


to build a new cryptosystem.
 AES (Advanced Encryption Standard) is a Rijndael
encryption algorithm that was standardized in 2002.
 AES will be gradually used to replace DES and
3DES.

3
AES Specifications

AES has 3 independent versions, differing in key length

4
AES Algorithm

•AES algorithm performs


through 10 rounds, each
round 4 operations.
•Encryption and
decryption algorithms are
independent => all
operations in the
algorithm must have
inverse operations

5
Data processing in AES

•The block size of AES data is 128 bits (16 bytes) which is
arranged in a 4x4 matrix (1 byte/each element) called the
“state array”.
•Each round of processing will change the value of the array.
•The matrix of the last round is the output of the algorithm.

6
Basic operations in AES

 Byte Substitution
 Shift Rows
 Mix Columns
 Add Round Key

Operations in AES are performed in the field


GF(28)

7
Byte Substitution (S-box)

Each byte in the “state


table” is divided into 2
parts:
 the first 4 bits select
the line
 the last 4 bits select
the column.
Example:
14: row 1, column 4 → FA
A5: row A column 5 → 06

8
Byte Substitution (S-box)
24 96 05 1A

BA 19 CF 25

AC 1D 32 89

19 56 2F CA

36 90 6B A2
F4 D4 8A 3F
91 A4 23 A7
D4 B1 15 74

9
Byte Substitution (Inverse S-box)

10
Initialize the S-box matrix
 Initialize the matrix with the element's value exactly
equal to the element's index, i.e. the element at
position {x,y} has the value xy
 Replace each element in the matrix with its inverse
in the field GF(28)
 Consider each byte in the matrix as a bit string
b7b6b5b4b3b2b1b0
 Apply the following transformation to each bit string

11
Initialize the S-box matrix

Apply normal matrix multiplication, with


addition replaced by XOR

12
Initialize the S-box matrix
Table of multiplicative inverses: rs*inv(rs) = 01
s
inv(rs)
0 1 2 3 4 5 6 7 8 9 a b c d e f

0 XX 01 8d f6 cb 52 7b d1 e8 4f 29 c0 b0 e1 e5 c7

1 74 b4 aa 4b 99 2b 60 5f 58 3f fd cc ff 40 ee b2

2 3a 6e 5a f1 55 4d a8 c9 c1 0a 98 15 30 44 a2 c2

3 2c 45 92 6c f3 39 66 42 f2 35 20 6f 77 bb 59 19

4 1d fe 37 67 2d 31 f5 69 a7 64 ab 13 54 25 e9 09

5 ed 5c 05 ca 4c 24 87 bf 18 3e 22 f0 51 ec 61 17

6 16 5e af d3 49 a6 36 43 f4 47 91 df 33 93 21 3b

7 79 b7 97 85 10 b5 ba 3c b6 70 d0 06 a1 fa 81 82
r

8 83 7e 7f 80 96 73 be 56 9b 9e 95 d9 f7 02 b9 a4

9 de 6a 32 6d d8 8a 84 72 2a 14 9f 88 f9 dc 89 9a

a fb 7c 2e c3 8f b8 65 48 26 c8 12 4a ce e7 d2 62

b 0c e0 1f ef 11 75 78 71 a5 8e 76 3d bd bc 86 57

c 0b 28 2f a3 da d4 e4 0f a9 27 53 04 1b fc ac e6

d 7a 07 ae 63 c5 db e2 ea 94 8b c4 d5 9d f8 90 6b

e b1 0d d6 eb c6 0e cf ad 08 4e d7 e3 5d 50 1e b3

f 5b 23 38 34 68 46 03 8c dd 9c 7d a0 cd 1a 41 1c

13
Initialize the S-box matrix
Example: consider the input value {95}. The
multiplicative inverse in GF(28) is {95}1 = {8A}, which
is 10001010 (b7->b0)

The result is {2A}, which should appear


in row {09} column {05} of the S-box.

14
Initialize the inverse S-box matrix

15
Shift Rows

1st Row stays the same


2nd Row shifts left 1 byte
3rd Row shifts left 2 bytes
4th Row shifts left 3 bytes
16
Mix Columns

Mix Columns

17
Mix Columns

Let us verify the first column of this example. Recall from


Section 4.6 that, in GF(28), addition is the bitwise XOR
operation and that multiplication can be performed according to
the rule established in Equation (4.10). In particular,
multiplication of a value by x (i.e., by {02}) can be implemented
as a 1-bit left shift followed by a conditional bitwise XOR with
(0001 1011) if the leftmost bit of the original value (prior to the
shift) is 1. Thus, to verify the MixColumns transformation on the
first column, we need to show that

18
Mix Columns

19
Mix Inverse Columns
Mix Inverse Columns

20
Add Round Key

 Perform an XOR between 128 bits of the current


state matrix with 128 bits of Sub-keys at the
corresponding round.
 This operation has no inverse operation.

21
Sub-key Generation Algorithm

 The original 128-bit key is expanded to 176 bytes.


 176 bytes divided into 44 words (4 bytes/word) ->
10 Sub-keys for 10 rounds of cipher + 1 Sub-key for
initial key addition.
 11 Sub-keys. 4 words/sub-key (128bits/sub-key)

22
Sub-key Generation Algorithm

23
Sub-key Generation Algorithm

24
Sub-key Generation Algorithm

G function:
1. Rotword (left rotate)
1 byte
2. Subword (Sbox)
3. Add round constant

Round constant:

25
Example
Suppose that the round key for round 8 is
EA D2 73 21 B5 8D BA D2 31 2B F5 60 7F 8D 29 2F
Then the first 4 bytes (first column) of the round key for
round 9 are calculated as follows:

26
Comments

 AES overcomes the weaknesses of DES.


 AES ensures simple design, fast execution speed, and
security.
 The number of AES-based applications is not yet
numerous, but will rapidly increase in the near
future.

27
Block cipher modes
Block cipher mode is a method of implementing an
encryption algorithm on a chain of many original
blocks of information.
 Electronic Code Book mode (ECB)
 Cipher Block Chaining mode (CBC)
 Cipher Feedback mode (CFB)
 Output Feedback mode (OFB)
 Counter mode (CTR)

28
Electronic Code Book (ECB)

29
Electronic Code Book (ECB)

30
Cipher Block Chaining (CBC)

31
Cipher Block Chaining (CBC)

32
Cipher Feedback (CFB)

33
Output Feedback (OFB)

34
Counter (CTR)

35
Other Symmetrical Encryption Algorithms

 IDEA (International Data Encryption Algorithm)


 Blowfish
 RC4 and RC5
 CAST-128

36
Other Symmetrical Encryption Algorithms

37
Key exchange in symmetric encryption
 Symmetric encryption advantages: high encryption
speed, suitable for large-sized data transmission
applications =>The secret key exchange mechanism
between the two sides of the information is the basic
problem.
 The key request must be exchanged between the two
parties through a secure channel. How is a secure
channel built if encryption algorithms cannot be
applied yet? If the channel is secure, is it possible to
send data directly to this channel without encryption?
38
Key exchange in symmetric encryption
 In practice, the secret key can be exchanged between
two parties by any method that can be used, for
example, by hand exchange, e-mail exchange,
telephone exchange, or using some method of hiding
information. When asymmetric cryptography is
available that the key exchange process can be
resolved in a valid way.
 Currently, both symmetric and asymmetric
encryption techniques exist in parallel, even in the
same application and transaction.
39

You might also like