CH02 - 500pts
Last updated
Was this helpful?
Last updated
Was this helpful?
Below are 4 messages, 2 of them are insecure... find the flag!
2e310d15730618003c27392502592f1b016e1b1c364505191302
27271e1d6f3935381618340a740404152d0063160106490a0a050d013d2e
313c0d45350d0c026f3d236b361120191e373c1c3a080e0c2b04
1b060c2749020b354105271616532f27772f1c204811111745320b10021717
First, we guess that the cipher being used is a since two of the hexadecimal strings are the same length.
So we have cipher text one 2e310d15730618003c27392502592f1b016e1b1c364505191302
and cipher text two 313c0d45350d0c026f3d236b361120191e373c1c3a080e0c2b04
that were both encrypted using the same one-time pad key. If the key for a one-time pad is used twice, it can be broken using .
Basically, XORing the cipher texts gives you the same result as XORing the original messages. The math works out as follows (from ):
This is useful because XORing the two cipher texts removes the key from the problem.
We can XOR the two cipher texts using [CyberChef (click for recipe)]() to get 1f0d0050460b1402531a1a4e34480f021f5927000c4d0b153806
. This hexadecimal string is equal to the two messages XORed together. Therefore, we can start guessing parts of a message to decode both cipher texts and get the flag. makes this easy.
python2 cribdrag.py 1f0d0050460b1402531a1a4e34480f021f5927000c4d0b153806
:
ShimmyShimmyYa