I understand the concept that when you xor the cipher texts you get the XOR messages cause the keys get XOR-ed and cancel out... This is at least the case when both the messages are of equal lengths.

What about when both the messages are of different lengths? Does the shorter message get padded? Which of the key would be of the original length key (non-padded)?


1 Answer 1


No usually the shorter message doesn't get padded, you can just not decrypt or at least analyse the last part of the longer message. If the key is not even the same size as the message then you are dealing with a variation of the Vigenere cipher, not with a one-time-pad.

What happens in practice is of course dependent on the situation. But if the key is reused of an OTP then the security is lost, and usually in a rather catastrophic way.


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.