A completely random one-time encryption panel

I need to create a one-time block to encrypt some data (several KB in size). How should I create this one-time block to avoid all the pseudo-random problems associated with generating basic random numbers like rand() ?

Is there an existing, reliable tool or library for this?

+6
random cryptography one-time-password
source share
3 answers

Try Random.ORG . They have various free (and paid) services that generate truly random numbers based on atmospheric noise (or at least that's what they claim).

+4
source share

Most modern operating systems have a cryptographically secure pseudo random number generator .

For example, Windows has a CryptGenRandom . You can access the same stream from .NET using the RNGCryptoServiceProvider class. From C ++, you can access the same stream using the Microsoft C ++ rand_s library function. From Python, it is accessible using the urandom function (see bottom of the linked page) in the os module.

Unlike conventional PRNGs, CSPRNGs are designed to conduct rigorous randomness statistical tests. They are also designed to seriously attack a serious attack, even when their initial or neglected state becomes available to an attacker.

The term "pseudo-random" used by cryptographers can be misleading to a non-technical reader. CSPRNG extends the set of random values ​​known as a seed into a longer sequence of numbers. This sequence is reproducible with respect to the seed, but for any good CSPRNG, a slight change in the seed gives a completely different sequence. Therefore, while at least a portion of the seeds has been selected through an adequately random process, the attacker cannot predict the sequence obtained - even if the attacker can influence the rest of the seed.

Numerous important systems, ranging from military communications to encryption that protects almost all online transactions, rely on functionally equivalent security between “cryptographically secure pseudorandom” and “random”.

EDIT . If you are fortunate enough to work with an Intel Ivy Bridge processor, now you have another very interesting alternative .

+5
source share

You cannot generate truly random numbers algorithmically - you need hardware help. If you use an algorithm, no matter how secure it is (for example, cryptographically secure PRNG), you simply create a stream cipher based on this PRNG; this is no longer a one-time panel.

+4
source share

All Articles