🚩 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

  1. Nonce reuse: Since C_1 = P_1 ^ Keystream and C_2 = P_2 ^ Keystream, then C_1 ^ C_2 = P_1 ^ P_2.

  2. We know P_1 (a welcome message like β€œHello Guest!”). We calculate the Keystream: Keystream = C_1 ^ P_1.

  3. Decrypt the flag ciphertext C_flag by XORing it with the recovered keystream: P_flag = C_flag ^ Keystream.