Documente Academic
Documente Profesional
Documente Cultură
AES Lab 1
University of Pittsburgh: School of Information Sciences
Graduate Program in Telecommunications and Networking
Part I: Introduction
AES is the advanced encryption standard that is replacing DES and 3-DES. The purpose
of this lab is to use Advanced Encryption Standard (AES) encryption and decryption
routines in Matlab to revisit some concepts studied in class. For this purpose, we are
using Matlab routines written by Prof. Jörg J. Buchholz. In particular we will look at the
following concepts:
a) Randomness of output and the avalanche effect
b) Triple encryption using two keys
c) Brute force attack with partial knowledge of the key
The estimated time for completing this lab is three hours.
AES Lab 2
University of Pittsburgh: School of Information Sciences
Graduate Program in Telecommunications and Networking
Note: The Matlab program should be run under the AES directory.
• To run the matlab file called aes_demo.m, in the Matlab prompt use:
>> aes_demo
Notes:
• You may use “pico” or “vi” or other editors to edit a Matlab file. (“pico” is easier to
use.)
• The above procedure in the lab is an option. You can use other procedures to get the
solution for this lab exercise but it is required that the given Matlab files are used.
Edit the “aes_demo.m” file and change the plaintext to the following:
Plaintext: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
Note : In order to see the ciphertext only, the “re_plaintext” line should be
commented out by using “%” sign in front of the line. Otherwise decryption is also
done that will take additional time.
Key: ab 11 ba 22 bc 33 cb 44 cd 55 dc 66 de 77 ed 88
Save with the same file name. Run aes_demo1.m and determine the ciphertext.
Note: It takes a few minutes to run the program. Record it here:
Ciphertext:
Ad
Avalanche effect:
Change the first two characters of the plaintext to “01”. Determine the new
ciphertext and record it here.
AES Lab 3
University of Pittsburgh: School of Information Sciences
Graduate Program in Telecommunications and Networking
Next change the first two characters in the original ciphertext to “ff”. Use the
same key to decrypt the ciphertext. Record the plaintext here:
Here [1], [2], …[16] are number at the positions in the ciphertext matrix as follow:
AES Lab 4
University of Pittsburgh: School of Information Sciences
Graduate Program in Telecommunications and Networking
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
2. Triple-AES Encryption
Key1 (k1): ab 11 ba 22 bc 33 cb 44 cd 55 dc 66 de 77 ed 88
Key2 (k2): 00 ff 11 ee 22 dd 33 cc 44 bb 55 aa 66 99 77 88
Determine:
a) y1 = ek1 (d k 2 (ek1 ( x))) . Record it here.
c) x1 = d k1 ( y1 ) . Record it here.
d) x2 = d k1 ( y2 ) . Record it here.
AES Lab 5
University of Pittsburgh: School of Information Sciences
Graduate Program in Telecommunications and Networking
Given Plaintext: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
Given Ciphertext:
30 4d 6c e0
43 0a cb 44
91 ef 6d cf
b3 eb d5 31
12 23 34 45 56 67 78 89 9a ab bc cd de ef f0
Find the remaining key by writing a Matlab program, which is modified from the original
aes_demo.m file. For simplicity, you know most of the key except for the given range of
the last part of the key (from 0 – 63 (decimal)). Submit the Matlab program as well.
AES Lab 6
University of Pittsburgh: School of Information Sciences
Graduate Program in Telecommunications and Networking
12 23 34 45 56 67 78 89 9a ab bc cd de ef f0
AES Lab 7