AlexCTF 2017 - CR2 Many time secrets
Category: writeupsTags: alexctf-2017 crypto
CR2 Many time secrets
Crypto - 100 Points
This time Fady learned from his old mistake and decided to use onetime pad as his encryption technique, but he never knew why people call it one time pad!
Writeup
OneTime Pad is the strongest cipher ever. It has been proved that it can’t be cracked even if the attacker have unlimited memory, computing power and time.
But this is true if and only if the key is single-use, truly random and have the same lenght as the message.
In the challenge we have 11 messages encrypted with the same key.
Note: Someone resolved this callenge with featherduster, an automatic tool that do analisys on the cyphertext and give you the message directly (in this case).
We think that this type of automatic tool is ‘useless’ in this type of competition, where participant should resolve challenges by thinking with their own heads.
We resolved the challenge manually, anyway the tool was explicitly allowed by the AlexCTF organizer.
Since we know that the flag format is ALEXCTF{flag}
we started XORing every message with the first part of the key. (see Step 1 in the final script)
And From the first message we get: 'Dear Fri'
So we guess that the first message was starting with 'Dear Friend, '
, XORing this with the first cypertext returned the first part of the key ALEXCTF{HERE_
.
At this point we already got the flag just by guessing but we wanted to verify that step by step. A simple XOR would have worked
We XORed again every message with the new key above (see Step 3 in the final script).
The last deciphered message was 'ncryption sch'
. Obviously (e)'ncryption scheme '
, so we XORed that to get another part of the key ALEXCTF{HERE_GOES
.
Again, by XORing the new key with every cyphertext the third message resulted in:
'sed One time pad e'
That is obviously 'sed One time pad encryptio'(n)
(note the message length).
Annnnnd……
ALEXCTF{HERE_GOES_THE_KEY}
Final script for the record