11

Let's pretend that all digits of pi are known and arbitrarily long sequences of digits are trivial to get. Further, some mathematician proves that there are no patterns in pi. We could create a stream cipher by grabbing a piece of pi as long as our plaintext and combining the two with some function (such as XOR or modulus addition.) The key would be the starting position in pi.

Would this be equivalent (in terms of security) to a one-time pad? To what sort of attacks would it be vulnerable?

Joshua Galecki
  • 213
  • 2
  • 4

4 Answers4

15

The problem with this approach is that it literally gains you nothing. In order to choose a random subsequence of a needed length from $\pi$, you need to generate a cryptographically random number of at least the same length of the desired key to use as the offset. But then you may as well just use that number as your secret key.

Other than that, yes, it's exactly the same as a one-time pad. Just with a silly and pointless key derivation protocol which cannot mathematically increase the security of the system, but could conceivably weaken it.

Edit: As Thomas points out in the comments, the distribution of digits of $\pi$ are not random, and so this mechanism of key generation actually discards a significant amount of entropy that had been generated while choosing a random offset.

Stephen Touset
  • 11,162
  • 1
  • 39
  • 53
3

I have a strong interest in one time pads, and I would suggest that your scheme is a poor substitute for two reasons:-

1.

What is the key to decode the message? It would have to be related (however indirectly) to the start position in the $\pi$ sequence. For example, you can decode my "Hello Joshua" message by starting XORing from (say) the 20,503rd digit of $\pi$. So the key is 20503.

A bit short eh? It's only 14 bits. For shortish messages we'd accept 96 bit keys (counter modes), but really want to keep them to at least 128 bits. That's $340 \times 10^{36}$. Timothy Mullican has just computed 50 trillion digits of $\pi$ using y-cruncher. It took a while, needed a few servers and that 'key' would still only be 46 bits long.

So yes, while you can compute individual $\pi$ digits, it gets progressively harder the further downstream you go. Frankly, it's hopeless.

2.

Repudiation. If you destroy the OPT used to encrypt the message, no one will ever recover the plain text. Most of the the cold war OTP messages have never been decrypted for this reason. Your OPT will always exist and it's only a matter before someone stumbles upon the key /pointer.

Paul Uszak
  • 15,905
  • 2
  • 32
  • 83
-1

If it were possible to compute digits of pi from an arbitrary location (to generate the stream) in constant time, then it would be an excellent cipher. Unfortunately, this isn't possible.

Maurer suggested using the surface of the moon for a source of random information instead: link

Mike Edward Moras
  • 18,161
  • 12
  • 87
  • 240
-1

Your algorithm is vulnerabel to brute force attacks. XOR the ciphertext with parts of the PI fraction starting with n and then with n+1 and so on. Today's fast computers won't take long to crack it. :)

paul
  • 1