Level 2 - Leaky Matrices
Last updated
Last updated
Looks like PALINDROME implemented their own authentication protocol and cryptosystem to provide a secure handshake between any 2 services or devices. It does not look secure to us, can you take a look at what we have got?
Try to fool their authentication service: nc chal00bq3ouweqtzva9xcobep6spl5m75fucey.ctf.sg 56765
This was a pretty straightforward crypto challenge where a weak authentication scheme allowed the leaking of the secret key through a challenge-response sequence. This relied on the following matrix multiplication in .
Importantly, this is equivalent to
The solution to this challenge is to simply probe the server with 00000001
, 00000010
, ... 10000000
, and when challenged, take the 1-bits and add up their corresponding probed values.
This gives us the flag.
Since we control the challenge bits c, we could leak the result of each column by challenging the server. For example, setting gives us
and since we can do the same for all , we could reconstruct the response to any challenge by adding up the relevant column results.
Since this happens in , addition is the same as XOR (hence the use of XOR in the script).