Problem with the pseudo random number generator One-Time-Pad

54 Views Asked by At

I've started learning cryptography in class and we've come across One-Time-Pads, in which the key (uniformally agreed upon) is as long as the message itself. Then you turn the message into bits, do $XOR$ and get the cipher text. This encrypts the message and to decrypt the message you'd do $XOR$ with the cipher and key bits.

Now to make a more efficient One-Time-Pad you'd use a pseudo-random number generator, where the original key is n-bits long (and doesn't have to be as long as the message). Then you'd put the key in the generator and get a pseudo random number. But since it's pseudo random, wouldn't the sender and receiver get different keys? Then how can the receiver decrypt the message if they don't have the same key?

1

There are 1 best solutions below

0
On BEST ANSWER

The whole point is that a PRNG $G$ is deterministic: with a given seed $s$ it will produce the same sequence $G(s)$ every time. So when both sides use the same seed (that they have to agree on beforehand, this is the $n$-length key) they will produce the same sequence and thus one side can decrypt what the other encrypts. The pseudo- is because it's not really random, it just has to be hard to distinguish it from real random (from coin flips or some such source) if you don't know the seed.