Professional Documents
Culture Documents
Akash Kumar
Project Guidelines
Work in pairs Develop a 128-bit AES decryption engine In C language running on a Microblaze-based platform on FPGA In VHDL running on FPGA While one C-implementation is sufficient, multiple
VHDL alternatives should be explored in terms of area and timing Measure speed-ups Plot all implementations on a Pareto curve
Akash Kumar EE4218 2
Pareto Curve
Resources
Performance-1
Project Implementation
Key and Encoded image Encoded and Decoded image
Microblaze-based Design
Read the key & encoded image from serial port FSL FIFO Run on MB and on hardware, and compare speedup Decrypt the image with the key Decrypt the image with the key FSL FIFO Display the encoded and the decoded image Running on Microblaze
Akash Kumar EE4218 5
What is Provided!
A very useful wiki page:
http://wiki.nus.edu.sg/display/ee4218
Links to resources Updates FAQs
Sources
Cryptography and Network Security by
Behrouz A. Forouzan, 2008, (book and slides) Mc Graw Hill. AES Wiki page: http://en.wikipedia.org/wiki/Advanced_Encryption _Standard Flash animation by Enrique Zabala (very useful): http://www.cs.bc.edu/~straubin/cs38105/blockciphers/rijndael_ingles2004.swf
Akash Kumar EE4218 8
adopted by the U.S. government Developed by two Belgian cryptographers Vincent Rijmen and John Daemen: also known as Rijndael Standard has three key-sizes 128, 192, 256 bits For the project, use key-size of 128 bits Block size is also 128 bits (16 = 4x4 bytes) AES ciphers used worldwide.
Akash Kumar EE4218 9
Plain Text
Add Round Key
Cipher Key
Inv Sub Bytes Inv Shift Rows Inv Mix Column Add Round Key Inv Sub Bytes Inv Shift Rows Add Round Key
Repeated in 9 Rounds
Shift Rows Mix Colums Add Round Key Sub Bytes Shift Rows Add Round Key
Repeated in 9 Rounds
Cipher Text
10
b0 b1 b2 b3 b4 b5 b6 b7
1 Word = 4 bytes
b0 b1 b2 b3
1 Block = 4 words
b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b4 b5 b6 b7 b8 b12 b9 b13 b10 b14 b11 b15
b0 b1 b2 b3
1 State = 1 block
11
Substitute Bytes
12
Substitution Box
0x 0 10 20 30 40 50 60 70 80 90 a0 b0 c0 d0 e0 f0 0 63 ca b7 4 9 53 d0 51 cd 60 e0 e7 ba 70 e1 8c 1 7c 82 fd c7 83 d1 ef a3 0c 81 32 c8 78 3e f8 a1 2 77 c9 93 23 2c 0 aa 40 13 4f 3a 37 25 b5 98 89 3 7b 7d 26 c3 1a ed fb 8f ec dc 0a 6d 2e 66 11 0d 4 f2 fa 36 18 1b 20 43 92 5f 22 49 8d 1c 48 69 bf 5 6b 59 3f 96 6e fc 4d 9d 97 2a 6 d5 a6 3 d9 e6 6 6f 47 f7 5 5a b1 33 38 44 90 24 4e b4 f6 8e 42 7 c5 f0 cc 9a a0 5b 85 f5 17 88 5c a9 c6 0e 94 68 8 30 ad 34 7 52 6a 45 bc c4 46 c2 6c e8 61 9b 41 9 1 d4 a5 12 3b cb f9 b6 a7 ee d3 56 dd 35 1e 99 a 67 a2 e5 80 d6 be 2 da 7e b8 ac f4 74 57 87 2d b 2b af f1 e2 b3 39 7f 21 3d 14 62 ea 1f b9 e9 0f c fe 9c 71 eb 29 4a 50 10 64 de 91 65 4b 86 ce b0 d d7 a4 d8 27 e3 4c 3c ff 5d 5e 95 7a bd c1 55 54 e ab 72 31 b2 2f 58 9f f3 19 0b e4 ae 8b 1d 28 bb f 76 c0 15 75 84 cf a8 d2 73 db 79 8 8a 9e df 16
(C-1(x) b)
Mix Columns
C(x)a
Akash Kumar EE4218 16
0 E 0 B 0 D 09 09 0 E 0 B 0 D C 1 = 0 D 09 0 E 0 B 0 B 0 D 09 0 E
C B = C C A = A
Inverse Mix Column
Akash Kumar EE4218 17
18
A K = B B K = A K K = A0 = A
Therefore, adding round key two times returns
KEY EXPANSION
20
Key Expansion
11 different keys needed in total First one is the cipher key
W0 W1 W2 W3
21
Key Expansion
Round Pre-round Round 1 Round 2 Round 3 Round 4 Round 5 Round 6 Round 7 Round 8 Round 9 Round 10 w0 w1 w2 w3 w4 w5 w6 w7 w40 w41 w42 w43
Akash Kumar EE4218 22
Key
Key Expansion
23
byte
B0 B1 B2 B3 B1 B2 B3 B0
Round Constants
In each round a different word is added (XORed)
R1 01 00 00 00 R2 02 00 00 00 R3 04 00 00 00 R4 08 00 00 00 R5 10 00 00 00 R6 20 00 00 00 R7 40 00 00 00 R8 80 00 00 00 R9 1B 00 00 00 R10 36 00 00 00
25
Observations
Note that for decryption the keys are needed in
reverse order Key schedule generation can be pipelined note the dependencies in Slide 23 See if there is any potential of hardware reuse You may want to test your design with test vectors provided in official AES standard available on the EE4218 Project Wiki
26