Week5. Advanced Encryption Standard: Lecture Slides by Zhanbolat Seitkulov

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

Week5.

Advanced Encryption
Standard
Lecture slides by Zhanbolat Seitkulov

February IITU, Information Security 1


•  “It seems very simple.”
•  “It is very simple. But if you don’t know what
the key is it is virtually indecipherable.”
•  Talking to Strange Men, Ruth Rendell

February IITU, Information Security 2


Outline
•  We will consider:
–  The AES selection process
–  The details of Rijndael – the AES cipher
–  Steps in each round
–  The key expansion
–  Implementation aspects

February IITU, Information Security 3


AES History
•  Replacement for DES was needed
–  Have theoretical attacks that can break it
–  Have demonstrated exhaustive key search attacks
•  Can use triple DES – but slow, has small blocks
•  US NIST issued call for ciphers in 1997
•  15 candidates were accepted in June 1998
•  5 were shortlisted in August 1999
•  Rjindael was selected as the AES in October 2000
•  Issued as FIPS PUB 197 standard in November
2001
February IITU, Information Security 4
The AES Cipher - Rjindael
•  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 bytes
–  Operates on entire data block in every round
•  Designed:
–  To be resistant against known attacks
–  For speed and code compactness on many CPUs
–  For structural simplicity
February IITU, Information Security 5
AES Versions

February IITU, Information Security 6


AES Structure
•  Data block of 4 columns of 4 bytes is state
•  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 multiply of groups)
–  Add round key (XOR state with key material)
–  View as alternating XOR key and scramble data bytes
•  Initial XOR key material and incomplete last round
•  With fast XOR and table lookup implementation

February IITU, Information Security 7


AES
Encryption
Process

February IITU, Information Security 8


AES
Structure

February IITU, Information Security 9


Single AES
Round

February IITU, Information Security 10


Some Key Properties of AES
•  An iterative rather than Feistel cipher
•  Key expanded into array of 44 32-bit words
–  Four distinct words used as round key for each round
•  4 different stages are used
•  Has a simple structure
•  Only AddRoundKey uses key
•  AddRoundKey a form of Vernam cipher
•  Each stage is easily reversible
•  Decryption uses keys in reverse order
•  Decryption does plaintext recover
•  Final round has only 3 stages
February IITU, Information Security 11
AES Data Processing

February IITU, Information Security 12


Substitute Bytes
•  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)
–  E.g. 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

February IITU, Information Security 13


Substitute Bytes

February IITU, Information Security 14


Substitute Bytes Example

February IITU, Information Security 15


February IITU, Information Security 16
Shift Rows
•  A circular byte shift in each row
–  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

February IITU, Information Security 17


Shift Rows

February IITU, Information Security 18


AES Arithmetic
•  AES uses arithmetic in GF(28)
•  With irreducible polynomial
–  m(x) = x8 + x4 + x3 + x + 1
–  which is (100011011)2

February IITU, Information Security 19


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

February IITU, Information Security 20


Mix Columns Inverse

February IITU, Information Security 21


Mix Columns

February IITU, Information Security 22


Mix Columns Example

February IITU, Information Security 23


Mix Columns Example

February IITU, Information Security 24


Mix Columns Summary
•  Can express each new column as 4 equations
–  Each derives one new byte in new column
•  Decryption requires use of inverse matrix
–  With larger coefficients, hence a little harder
•  Have an alternate characterization
–  Each column a 4-term polynomial
–  With coefficients in GF(28)

February IITU, Information Security 25


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

February IITU, Information Security 26


Add Round Key

February IITU, Information Security 27


AES Round

February IITU, Information Security 28


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 and 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

February IITU, Information Security 29


AES Key Expansion

February IITU, Information Security 30


Key Expansion Comments
•  Designed to resist known attacks
•  Design criteria included:
–  Knowing part key insufficient to find many more
–  Invertible transformation
–  Fast on wide range of CPU’s
–  Use round constants (RCj) to break symmetry
–  Diffuse key bits into round keys
–  Enough non-linearity to hinder analysis
–  Simplicity of description

February IITU, Information Security 31


Round Constant (RCj)

February IITU, Information Security 32


AES Key
Expansion
Example

February IITU, Information Security 33


AES
Encryption
Example

February IITU, Information Security 34


AES
Avalanche
Example

February IITU, Information Security 35


AES Decryption
•  AES decryption is not identical encryption
since steps done in reverse
•  but can define an equivalent inverse cipher
with steps as for encryption
–  But using inverses of each step
–  With a different key schedule
•  Works since result is unchanged when
–  swap byte substitution and shift rows
–  swap mix columns and add round key

February IITU, Information Security 36


AES Decryption

February IITU, Information Security 37


AES Implementation Aspects
•  Can be efficiently implemented:
–  Byte substitution works on bytes using a table of 256
entries
–  Shift rows is simple byte shift
–  Add round key works on byte XOR’s
–  Mix columns requires matrix multiply in GF(28) which
works on byte values, can be simplified to use table
lookups and byte XOR’s
•  Designers believe this very efficient
implementation was a key factor in its selection
as the AES cipher
February IITU, Information Security 38
Questions?

February IITU, Information Security 39


Reading
•  Cryptography and Network Security by
Stallings
–  Chapter 5

February IITU, Information Security 40


Advanced Encryption Standard

Lecture slides by Zhanbolat Seitkulov

February IITU, Information Security 41

You might also like