+ All Categories
Home > Documents > AES Algorithm

AES Algorithm

Date post: 26-Oct-2014
Category:
Upload: ahmad-shdifat
View: 77 times
Download: 1 times
Share this document with a friend
Description:
description for AES Algorithm that is used in the project "Light-Weight Encryption Processor v2".
Popular Tags:
25
Digital System Design AES Algorithm: A Quick Introduction
Transcript
Page 1: AES Algorithm

Digital System Design

AES Algorithm:

A Quick Introduction

Page 2: AES Algorithm

Acknowledgment

• I am borrowing slides from those sources:

– Lecture slides by Lawrie Brown for “Cryptography and Network Security”, 4/e, by William Stallings, Chapter Chapter 5 –”Advanced Encryption Standard”.

– Earlier project reports

Page 3: AES Algorithm

Encryption

• Encryption is transforming information (referred to as plaintext) using an algorithm (referred to as cipher) to make it unreadable to anyone except those possessing special key.

• The result of the process is encrypted information (referred to as ciphertext).

• The reverse process, i.e., to make the encrypted information readable again, referred to as decryption

Page 4: AES Algorithm

Encryption Key

• Symmetric-key Encryption: both the sender and receiver share the same key for encryption and decryption

• Asymmetric-key Encryption: two different keys are used: a public key and a private key – public key is used for encryption, and it is freely

distributed

– private or secret key is used for decryption and must remain secret.

.

Page 5: AES Algorithm

Input Data: Block vs. Stream

• A block cipher enciphers input in blocks of plaintext e.g. 4x4 bytes.

• Stream cipher process individual characters of the input data.

Page 6: AES Algorithm

Advanced Encryption Standard (AES)

• Block cipher – data block of 4 columns of 4 bytes is state

• 128-bit data • Symmetric-key

– 128/192/256-bit keys – key is expanded to array of words

• has 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

Page 7: AES Algorithm

Rounds and Transformation

Key

Size

Number of Rounds

AES-128 10

AES-192 12

AES-256 14

Algorithm consists of Number of Rounds. Each round consists of 4 transformations (steps).

Page 8: AES Algorithm

Algorithm

Each round consist of four

transformation functions:

SubBytes, ShiftRows,

MixColumns, and

AddRoundKey.

There is initial transformation

before first round it is

AddRoundKey (called Round

0).

The final round has only three transformations

Page 9: AES Algorithm

Initial Input • The input of each round is 4*4

matrixes and the output is 4*4 matrixes

• In the Cipher, the array is called State ( S), which consists of 4 rows of bytes, each row has 4 bytes, and each byte consists of 8 bits, thus total bits of the S is 4x4x8bits = 128 bits.

• Each individual byte has two indices row number r with range and column number

Page 10: AES Algorithm

State Array

• Each individual byte has two indices row number r with range and column number

Page 11: AES Algorithm

4 Transformation

• Byte Substitution ( SubByte)

• Shift Rows

• Mix Columns

• Add Round Key

Page 12: AES Algorithm

Byte Substitution

• a simple substitution of each byte

• uses one table of 16x16 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) – eg. byte {95} is replaced by byte in row 9 column 5

– which has value {2A}

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

• designed to be resistant to all known attacks

Page 13: AES Algorithm

Byte Substitution

Page 14: AES Algorithm

S-Box

Page 15: AES Algorithm

Shift Rows

• a circular byte shift in each each – 1st row is unchanged

– 2nd row does 1 byte circular shift to left

– 3rd row does 2 byte circular shift to left

– 4th 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

Page 16: AES Algorithm

Shift Rows

Page 17: AES Algorithm

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) =x8+x4+x3+x+1

Page 18: AES Algorithm

Mix Columns

Page 19: AES Algorithm

Finite Field Multiplication

• r = a . b , – Where a can be 02 or 03

• Then r is calculated as: case ( {a[0], b[7]} )

2'b11: r = (b<<1) ^ b^ 8'b0001_1011;

2'b10: r = (b<<1) ^ b ;

2'b01: r = (b<<1) ^ 8'b0001_1011;

2'b00: r = (b<<1) ;

endcase

{02}.{87}:

{a[0], b[7]} =01

r = (b<<1) ^ 8'b0001_1011

r = 0000_1110 ^ 0001_1011

= 0000_0101

= 15

Page 20: AES Algorithm

15 b2 46 A6

Page 21: AES Algorithm

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

– since XOR own inverse, with reversed keys

• designed to be as simple as possible

– a form of Vernam cipher on expanded key

– requires other stages for complexity / security

Page 22: AES Algorithm

Add Round Key

Page 23: AES Algorithm

AES Round

Page 24: AES Algorithm

AES Key Expansion

• takes 128-bit (16-byte) key and expands into array of 44/52/60 32-bit words

• start by copying key into first 4 words

• then loop creating words that depend on values in previous & 4 places back

– in 3 of 4 cases just XOR these together

– 1st word in 4 has rotate + S-box + XOR round constant on previous, before XOR 4th back

Page 25: AES Algorithm

AES Key Expansion


Recommended