Untrusted Node
HackTheBox
The challenge simulates an attack on a BB84-like Quantum Key Distribution (QKD) protocol. We play the role of a compromised Trusted Node between Transmitter (Alice) and Receiver (Bob). The goal is to intercept the quantum key, encrypt the command `TX|FETCH|SECRET`, and send it to the Receiver to obt
$ ls tags/ techniques/
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
Untrusted Node — HackTheBox
Description
The challenge simulates an attack on a BB84-like Quantum Key Distribution (QKD) protocol. We play the role of a compromised Trusted Node between Transmitter (Alice) and Receiver (Bob). The goal is to intercept the quantum key, encrypt the command TX|FETCH|SECRET, and send it to the Receiver to obtain the flag.
Protocol
- Transmitter generates 128 random bits and 128 random bases (gates: 0=Z, 1=X)
- For each bit,
kidentical copies of the qubit are created (k = Poisson(λ=2) + 2, i.e.,k ≥ 2, average ~4) - Qubits are sent through the Trusted Node (us) to the Receiver
- We can measure any qubits in a chosen basis or pass them through (
-1) to the Receiver - Receiver measures the received qubits in random bases
- Basis reconciliation phase: TX compares its bases with the ones we pass (we can substitute them)
- Where bases match — those bits form the key, hashed with SHA256
- The key is used for XOR encryption of commands
Source Files
server.py— TrustedNode: accepts our gates, measures/passes qubitstransmitter.py— Alice: generates qubits, checks basis matchesreceiver.py— Bob: measures qubits, processes commands, stores FLAGutil.py— XOR, validate_entropy (≥64 bits, binomial test p > 0.01)
Analysis
Key Vulnerability: Photon Number Splitting (PNS)
In real BB84, each qubit is a single photon, and measurement destroys the state. Here TX creates k ≥ 2 identical copies of each qubit. This is the classic PNS vulnerability — we can take some copies for ourselves while forwarding the rest to Bob without distortion.
Dual Measurement in Both Bases
...
$ grep --similar
Similar writeups
- [crypto][free]QLotto (Quantum Lottery)— HackTheBox
- [crypto][free]xorxorxor— hackthebox
- [crypto][free]Phase Madness— HackTheBox
- [crypto][free]Rhome— HackTheBox
- [blockchain][free]Magic Vault— hackthebox