So I am doing a CTF and I have found a text that is full with hexadecimal encrypted value with XOR (that was a given hint from the previous flag). I don't have the key but I know the length of the key is $8$. I also know that the word Congratulations is in the file somewhere. So, I guessed that if I XORed Congratu with the first 16 hex bytes assuming that I'll recover the key as a result to fully decrypt the message but that didn't seem to give me a correct result. I'm guessing that Congratulations may not be the first, which is why I'm having this issue. Is there anything that you guys recommend to solve this quickly?

  • 2
    $\begingroup$ XOR is not a cipher, for crying out loud. $\endgroup$
    – fkraiem
    Oct 10, 2017 at 2:51
  • $\begingroup$ @fkraiem That is, unless you have a (genuine) “one time pad” as key. ;) $\endgroup$
    – e-sushi
    Oct 10, 2017 at 11:23
  • $\begingroup$ @e-sushi Even then, that makes for a weird definition of "cipher"... $\endgroup$
    – fkraiem
    Oct 10, 2017 at 12:03
  • $\begingroup$ @fkraiem … which is why I added the winking smiley. I completely agree. I was just nit-picking; probably due to the fact we have a truckload of Q&As by new users who think they actually understand what OTP is, while not knowing (or ignoring) what it's not. Sometimes, I think we should put up a sign somewhere in the sidebar saying “XOR is a logical operation, not some cryptographic magic sauce turning dust into security”. $\endgroup$
    – e-sushi
    Oct 10, 2017 at 12:09
  • 1
    $\begingroup$ @fkraiem Unfortunately, there is this wikipedia article. Depending on the context, I would consider this to be an umbrella term for Vigenere, stream ciphers and (rarely) OTP. This isn't as bad as calling a stream cipher "one-time pad" though. $\endgroup$
    – tylo
    Oct 10, 2017 at 12:43

1 Answer 1


It sounds like a basic Vigenere cipher. From what you wrote, you even have some knowledge about the plaintext, but don't know the position.

You only tried out the first position, maybe just try this with shifting the worst to another position? Or just break the Vigenere cipher as if you knew only the keylength.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.