• Why is it that a one time pad is vulnerable is the key is shorter than the message?

• I know that if a key is reused across multiple plaintexts, you can XOR two existing ciphertexts to get the pad, but I'm not entirely sure how this works in practice.

Any help/ explanation is appreciated. Thanks.

## marked as duplicate by Squeamish Ossifrage, forest, otus, Maarten Bodewes♦Mar 11 at 1:44

If the key bits are shorter then the message you need to reuse some part of the previous key bits. If this is known, and we can assume by Kerckhoff Principles, then the enemy can crib-drag on the same message. A more dedicated enemy will always try this case and also the reuse case; the same key is used with another message, too.

As an example;

m = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
k = KkkkkkkkkkkkkkkkkkkkkkkkKkkkkkkkkkkkkkkkkk


where $$x$$ represents the message bits, $$k$$ represents the key bits and $$K$$ represents the start of the key bits. Divide the message into parts;

m1 = xxxxxxxxxxxxxxxxxxxxxxxx
k  = Kkkkkkkkkkkkkkkkkkkkkkkk
m2 = xxxxxxxxxxxxxxxxxx
k  = Kkkkkkkkkkkkkkkkkk


now, execute crib-dragging.