Score:1

Query about the Key of a One-Time Pad Cipher

sh flag

Having just finished reading The Code Book by Simon Singh, which I found extremely illuminating, nevertheless I remain deeply puzzled about one aspect in the book regarding the one-time pad cipher. To cut to the chase, I don't understand how a would-be hacker would be able to break a given OTP cipher (thereby deriving its plaintext) even if he or she already knew the key as well as its cybertext. Unlike the key of a Vigenere cipher, for instance, a key for a given OTP cipher is entirely random, therefore resistant to frequency analysis. The only workaround I can think of is that the OTP is itself a kind of Vigenere cipher? This, however, only takes me so far, sorry to relate. So to summarise: how can a hacker obtain an OTP's plaintext from its key? Many thanks!

poncho avatar
my flag
The valid recipient also has the ciphertext and the key - how does he decrypt the ciphertext to recover the plaintext?
Maarten Bodewes avatar
in flag
It's ciphertext - i.e. the output of a cipher, not cybertext :)
Score:3
la flag

I don't understand how a would-be hacker would be able to break a given OTP cipher (thereby deriving its plaintext) even if he or she already knew the key as well as its cybertext.

That’s like asking, “I don’t understand how to make a noise if all I have is a klaxon horn”. Um - blow the horn!

With an OTP, the “key” is a stream of random data of the same length as the plaintext message you want to encrypt.

  • You encrypt by XOR-ing each byte of the plaintext (P), with the corresponding byte of the random stream key (K). The result of that process is the ciphertext (C)(not “cybertext”).

  • You decrypt by XOR-ing each byte of the ciphertext C, with the corresponding byte of the exact same random stream key K. The result of that process is the original plaintext P.

So if you have C and K, that is all you need to get P.

Does that answer your question?

Whatshisname avatar
sh flag
Help! I'm a newbe to cryptography - i.e. I had to go to Wikipedia to find out what XOR meant, and I'm still not sure! So, no, I don't altogether get what you're saying (but thanks for the input). I guess having the principle demonstrated in real time by someone using a pen and paper would work for me. Still, even if the process remains a mystery, the take-home message is that the plaintext CAN be deciphered from its key by a third party, come what may. At least that's clear enough now.
fgrieu avatar
ng flag
@Whatshisname: what that answer (as well as the [first comment of the question](https://crypto.stackexchange.com/posts/comments/222454)) tells you is that with the key (also know as |secret] [random] pad) and ciphertext, all a hacker has to do is follow the normal decryption procedure of the OTP. You should understand how the OTP works in it's normal encryption and decryption uses, before trying to understand how it can be broken (if one of it's security assumptions does not hold).
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.