VP 320: AES (55 pts)


Use AES and attack it. I am following this excellent tutorial.

Installing Libraries

Execute these commands:
python3 -m pip install pyaes

Simple Encryption in ECB Mode

In a text editor, make this program:
import pyaes

key = b'sixteen_byte_key'
aes = pyaes.AESModeOfOperationECB(key)
plaintext = "16letter message"
ciphertext = aes.encrypt(plaintext)

Flag VP 320.1: Encrypt Text (5 pts)

Encrypt this plaintext with the specified key, using AES in ECB mode.
  • Key: 0123456789ABCDEF
  • Plaintext: Now is the time!
The flag is the ciphertext in hex.

Flag VP 320.2: Decrypt Text (5 pts)

Decrypt this ciphertext with the same key and mode used in challenge VP 320.1.
The flag is in the plaintext.

Flag VP 320.3: Decrypt Text (15 pts)

Decrypt this ciphertext. The key is 16 bytes long and contains only the letters A and a. The encryption is AES-ECB.
The flag is in the plaintext.

Flag VP 320.4: PBKDF2 (10 pts)

Find a 128-bit key using PBKDF2 with these parameters:
  • Password: password
  • Salt: saltsalt
  • Iterations: 1000
  • Hash function: SHA256
The flag is the key in hex.

Flag VP 320.5: CTR (20 pts)

Find the plaintext from this information:

Key derivation

  • Method: PBKDF2
  • Password: passwdNN, where NN is a two-digit number
  • Salt: same as password
  • Iterations: 5000
  • Hash function: SHA512
  • Key length: 128 bits


  • Method: AES-CTR
  • IV: same as key
  • Ciphertext: 3cadecb4838b558c4fb3ef79ef4e4a45794dfb
The flag is in the plaintext.

Posted 7-6-2020