Can I decode a message that was encrypted with a one-time pad if I have the key used to encrypt it? If so, how?

  • 1
    Normally it would just be a matter of XORing the key and the message. The specific details would depend on the form of the key - if it's binary, it's probably a bitwise XOR. If it's text, it might be bitwise, or at letter level (so message "A" with key "X" gives "Y") – Matthew Jan 24 '17 at 11:04
  • yes, and that key you have is the only way to decrypt it. – dandavis Jan 24 '17 at 15:01
  • If you tell us the format, we could write a code implementation to actually perform the decryption – J.A.K. Jan 24 '17 at 19:31

Yes, you can.

The one-time pad is usually employed as a symmetric encryption, i.e., encryption key and decryption key are the same. It is often as simple as applying XOR of key and message.

Note that the one-time pad suffers from some problems:

  • You can use a key exactly one time, otherwise the encryption is broken
  • There is no protection against altering the encrypted message
  • You need a way to exchange the one time pad keys in a secure way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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