Encryption: CS 465 January 9, 2006 Tim Van Der Horst
Encryption: CS 465 January 9, 2006 Tim Van Der Horst
CS 465
January 9, 2006
Classical Modern
Rotor Machines
Steganography
Stream Block
Symmetric Encryption Terms
Key Key
Alice Bob
Encryption Decryption
Algorithm Algorithm
What can go wrong?
Algorithm
Rely on the secrecy of the algorithm
Examples: Substitution ciphers
Algorithm is used incorrectly
Example: WEP used RC4 incorrectly
Key
Too small
Too big
Big numbers
Uses really big numbers
1 in 261 odds of winning the lotto and being hit by
lightning on the same day
292 atoms in the average human body
2128 possible keys in a 128-bit key
2170 atoms in the planet
2190 atoms in the sun
2233 atoms in the galaxy
2256 possible keys in a 256-bit key
Thermodynamic Limitations*
Physics: To set or clear a bit requires no less than kT
k is the Boltzman constant (1.38*10-16 erg/K)
T is the absolute temperature of the system
Build a Dyson sphere around the sun and collect all energy for 32
year, we could
Enough to cycle through a 192-bit counter.
x13 + x11 + x9 + x8 + x7 + x7 + x5 + x3 + x2 + x + x6 + x4 + x2 + x +1
and
=
1 5
9 13 S S1,1 S1,2 S1,3
0 1 2 3 4 5 6 7 8 9 1,0
10 11 12 13 14 15
2 6 10 14 S2,0 S2,1 S2,2 S2,3
3 7 11 15
S3,0 S3,1 S3,2 S3,3
AddRoundKey
XOR each byte of the round key with
its corresponding byte in the state
array XOR
S0,1
S0,0 S0,1 S0,2 S0,3
S1,1
S1,0 S1,1 S1,2 S1,3 S0,1
R0,1
S2,0 S S2,2 S2,3 S0,0 S0,1 S0,2 S0,3
S2,1
2,1 R0,0 R0,1 R0,2 R0,3 S
S3,0 S3,1 S3,2 S3,3 R1,1 R R S1,0 S1,1
1,1 S1,2 S1,3
R1,0 R
S3,1 1,1 1,2 1,3
S2,0S
S2,1 S2,2 S2,3
R2,0 R
R2,1 R2,2 R2,3 2,1
2,1
S3,0 S3,1 S3,2 S3,3
R3,0 R3,1 R3,2 R3,3 S3,1
R3,1
SubBytes
Replace each byte in the state array
with its corresponding value from the
S-Box
00 44 88 CC
11 55 99 DD
22 66 AA EE
33 77 BB FF
ShiftRows
S2,0 S
S2,1 S2,2 S2,3 S2,0S
S2,1 S2,2 S2,3
2,1
S3,c = ({03} S0,c) S1,c S2,c ({02} S2,1
3,c
S3,0 S3,1 S3,2 S3,3 S3,0 S3,1 S3,2 S3,3
S3,1 S3,1
Key Expansion
Expands the key material so that each
round uses a unique round key
Generates Nb(Nr+1) words
Filled with just
the key
state = in
SubBytes(state)
ShiftRows(state)
AddRoundKey(state, keySchedule[Nr*Nb, (Nr+1)*Nb-1])
out = state
Decryption
byte state[4,Nb]
state = in
InvShiftRows(state)
InvSubBytes(state)
AddRoundKey(state, keySchedule[0, Nb-1])
out = state
Encrypt and Decrypt
Encryption Decryption
AddRoundKey AddRoundKey
SubBytes InvShiftRows
ShiftRows InvSubBytes
MixColumns AddRoundKey
AddRoundKey InvMixColumns
SubBytes InvShiftRows
ShiftRows InvSubBytes
AddRoundKey AddRoundKey