Unbreakable
This is a writeup for Unbreakable, a challenge that was part of ASCWG 2025
Before we start, this challenge was one of the first attempts at creating a more 'realistic' cryptography challenge, which I respect, I will provide my feedback later.
Handouts
We're given a .pcap file containing a tls key exchange, and a params.txt containing DH parameters
-----BEGIN DH PARAMETERS-----
MIGHAoGBAQxn6qbQaxmBfw2xnnZangJ79Exx1gozR1dRf2NMytxLwq1+Qonj0E/D
wtyKvZubz5w7gVIjvvFc/fUEsr5wvGE/GYFVlhk1w3uoDDhQHdoWGRSKNgxMW/UZ
Yi0fIA5Lxf3jpYKqItSIJyYdaMtTimY5NF7mD7sav+GEAtqOoE8DAgEC
-----END DH PARAMETERS-----
Analysis & Solver
So, inspecting the packets in the pcap file we can extract the public diffie hellman parameters used in the key exchange, A, B, p, g, and the client random and server random, and lastly, the cipher suite used in encryption.


So the cipher suite is TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 .


Okay so we can just copy value for all these parameters, I noticed the p in the .pcap is not equal to the p in the params.txt. And I also noticed that p in the pcap is composite, so out of curiosity I did tried to gcd between them and I found that:
And that q = p_pcap // p_params is also a large prime, so from now on I'll rename p_pcap to N for context.
Now, we try factorizing p-1 (the order of p) and we find that its a bunch of 45 bit primes, very smooth lol.
So I decide to do pohlig-hellman to retrieve alpha.
This is stage 1, stage 2 of out attack is to build the client and server write keys + IVs using HMAC-SHA256 (inspired by the suite in the traffic)
output is:
Finally we take the application ciphertexts we got from the pcap file and decrypt using the keys
which gives us :
And that's it
Feedback
The only not so nice part about the challenge is that dh params contained a different public modulus to the one in the communication which caused some confusion, I think it's a little guessy.
But overall, nice chall, except for this minor detail, excited to see more 'realistic' challenges, but let's try to maintain a level of fun-to-solve experience while doing it, kudos to the writer :)).
Last updated