π© Challenge Overview
- Platform/Event: HTB Cyber Apocalypse 2025
- Difficulty: Medium
- Points: 250
- Solves: 198
- Category: Crypto
- Tags: AES-CTR, Nonce Reuse, Keystream Recovery, Known Plaintext
π Description
AES-CTR mode encryption reusing the same nonce/IV across different messages. Recover the keystream and decrypt the flag.
π‘ Solution / Approach
-
Nonce reuse: Since
C_1 = P_1 ^ KeystreamandC_2 = P_2 ^ Keystream, thenC_1 ^ C_2 = P_1 ^ P_2. -
We know
P_1(a welcome message like βHello Guest!β). We calculate the Keystream:Keystream = C_1 ^ P_1. -
Decrypt the flag ciphertext
C_flagby XORing it with the recovered keystream:P_flag = C_flag ^ Keystream.