Exclusive
Everyone loves XOR because it's easy to use but the cipher becomes vulnerable if you use only a single byte Key. We can easily brute-force the Key and recover our plaintext!
We already know that otp = int(os.urandom(1).hex(), 16)
will generate the . The encryption works like this
Split the otp byte into two halves i.e.
otpm = upper nibble(upper 4 bits), otpl = lower nibble(lower 4 bits)
Split the plaintext byte into two halves i.e.
m = upper nibble, l = lower nibble
Makes the XOR encryption and finally joins the ciphertext bytes.
Thus, we can
Reverse this and make our decryption function
Brute-force the key
Try to decrypt the ciphertext and check if all the characters are in the character space or not
Solve Script: solve.py
Flag: wormcon{x0r_n1bbl3_c1ph3r_15_4_h0m3_br3w3d_c1ph3r}
Last updated