python3 -m pip install pyaes
import pyaes
key = b'sixteen_byte_key'
aes = pyaes.AESModeOfOperationECB(key)
plaintext = "16letter message"
ciphertext = aes.encrypt(plaintext)
print(ciphertext.hex())
Flag VP 320.1: Encrypt Text (5 pts)
Encrypt this plaintext with the specified key, using AES in ECB mode.The flag is the ciphertext in hex.
- Key: 0123456789ABCDEF
- Plaintext: Now is the time!
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.
bf62ed16086c3d2c227998c18aed3d93
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.
cb2fd2a9c1b2ad307b1084d3641bf756
Flag VP 320.4: PBKDF2 (10 pts)
Find a 128-bit key using PBKDF2 with these parameters:The flag is the key in hex.
- Password: password
- Salt: saltsalt
- Iterations: 1000
- Hash function: SHA256
Flag VP 320.5: GCM (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
Encryption
The flag is in the plaintext.
- Method: AES-GCM
- Nonce: same as key
- Ciphertext: 47a46716341ce6c8a339ef02611542a2
Hint: For AES-GCM, see this project.
Hint: For PBKDF2, see this project.