CS 166: Information Security
- Prof. Tom Austin
Symmetric Key Crypto, Part 1 Prof. Tom Austin San Jos State - - PowerPoint PPT Presentation
CS 166: Information Security Symmetric Key Crypto, Part 1 Prof. Tom Austin San Jos State University Stream Ciphers & Block Ciphers Stream ciphers based on the one-time pad Block ciphers based on codebook ciphers Symmetric
– Examples: maj(0,1,0) = 0 and maj(1,1,0) = 1
– t = x13 Å x16 Å x17 Å x18 – xi = xi-1 for i = 18,17,…,1 and x0 = t
– t = y20 Å y21 – yi = yi-1 for i = 21,20,…,1 and y0 = t
– t = z7 Å z20 Å z21 Å z22 – zi = zi-1 for i = 22,21,…,1 and z0 = t
y0 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 y18 y19 y20 y21 z0 z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 z14 z15 z16 z17 z18 z19 z20 z21 z22
X Y Z
Å Å Å Å
x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18
1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 X Y Z
Å Å Å
Å 1 1 1 1 1 1 1 1 1 1
for i = 0 to 255 S[i] = i K[i] = key[i (mod N)] next i j = 0 for i = 0 to 255 j = (j + S[i] + K[i]) mod 256 swap(S[i], S[j]) next i i = j = 0
i = (i + 1) mod 256 j = (j + S[i]) mod 256 swap(S[i], S[j]) t = (S[i] + S[j]) mod 256 keystreamByte = S[t]
– Otherwise, related key attack exists
– Efficient in hardware – Speed was needed to keep up with voice, etc.
– Software-based crypto is usually fast enough
– Shamir declared “the death of stream ciphers” – May be greatly exaggerated…
Word Codeword Apple 00123 Banana 11439 Citrus 92340 Cranberry 87642 Durian 58629 Orange 66793 Strawberry 88432 Watermelon 90210
Input Output … … 9E CB 9F 80 A0 4F A1 ED A2 62 A3 9A … …
http://www.moserware.com/2009/09/stick-figure-guide-to-advanced.html
– 64 bit block length – 56 bit key length – 16 rounds – 48 bits of key used each round (subkey)
– Each S-boxes maps 6 bits to 4 bits
Odds of guessing key: roughly the same as winning the lottery & getting struck by lightning the same day. [Schneier 1996]
L R
expand shift shift
key key S-boxes
compress
L R
28 28 28 28 28 28 48 32 48 32 32 32 32
48 32
Ki P box Å Å
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
31 0 1 2 3 4 3 4 5 6 7 8 7 8 9 10 11 12 11 12 13 14 15 16 15 16 17 18 19 20 19 20 21 22 23 24 23 24 25 26 27 28 27 28 29 30 31 0
input bits (0,5) ¯ input bits (1,2,3,4)
| 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
01 | 0000 1111 0111 0100 1110 0010 1101 0001 1010 0110 1100 1011 1001 0101 0011 1000 10 | 0100 0001 1110 1000 1101 0110 0010 1011 1111 1100 1001 0111 0011 1010 0101 0000 11 | 1111 1100 1000 0010 0100 1001 0001 0111 0101 1011 0011 1110 1010 0000 0110 1101
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
15 6 19 20 28 11 27 16 0 14 22 25 4 17 30 9 1 7 23 13 31 26 2 8 18 12 29 5 21 10 3 24
49 42 35 28 21 14 7 0 50 43 36 29 22 15 8 1 51 44 37 30 23 16 9 2 52 45 38 31
55 48 41 34 27 20 13 6 54 47 40 33 26 19 12 5 53 46 39 32 25 18 11 4 24 17 10 3
13 16 10 23 0 4 2 27 14 5 20 9 22 18 11 3 25 7 15 6 26 19 12 1
12 23 2 8 18 26 1 11 22 16 4 19 15 20 10 27 5 24 17 13 21 7 0 3
– C = E(P, K)
– P = D(C, K)
– But P ¹ D(E(P, K1), K2) and C ¹ E(D(C, K1), K2) when K1 ¹ K2
– Exhaustive key search is feasible
– C = E(D(E(P,K1),K2),K1) – P = D(E(D(C,K1),K2),K1)
– Backward compatible: E(D(E(P,K),K),K) = E(P,K) – And 112 bits is enough