5
$\begingroup$

What are the methods for generating pseudo-random numbers in software? I have seen methods where people use SHA implementations from openssl to hash a random message as source of entropy, or using AES or Keccak. But I have done some experiments and found them quite slow. They take around more than 3 clock cycles in an intel 3.3GHz i5 processor to generate a random bit. Whereas pseudo-random generators like ISAAC are blazingly fast compared to other methods. Now my question is

  1. Why don't people use ISAAC for their implementations?
  2. Is ISAAC not secure enough for cryptographic applications?
  3. What are the other methods available for fast pseudo random number generation?

Thank you for your help.

$\endgroup$
3
  • $\begingroup$ I just like to remark that in the special (nevertheless practically not to be ignored) case of the communications of the common users where RSA is employed for encryption purposes, one needs to (ever) generate only two appropriate primes. In that case the efficiency issue of random number generation is evidently entirely irrevant and one should preferrably employ Maurer's algorithm of generation of provable primes (i.e. instead of statistically highly possibly primes). $\endgroup$ Commented Mar 11, 2017 at 12:55
  • 1
    $\begingroup$ @Mok-KongShen I fail to see how this has anything to do with the subject at hand; RSA is mentioned nowhere in the question. And sorry, but I dare to disagree with this. RSA key pair generation is often performed with high entropy random numbers, and it that case you may have issues with e.g. blocking RNG's. But instead of continuing the discussion on it, it would be nicer if you'd remove your comment. $\endgroup$
    – Maarten Bodewes
    Commented Mar 12, 2017 at 11:11
  • $\begingroup$ @MaartenBodewes: The first sentence of OP together with the beginning of his second sentence (via supplying an example) implies IMHO that he is highly concerned with the general efficiency issue of PRN generation on a computer. I was remarking that there is e.g. a (special) case of crypto applications where the efficiency issue of PRN generation is IMHO irrelevant. I don't yet clearly see why this remark is out of context here. $\endgroup$ Commented Mar 15, 2017 at 17:45

1 Answer 1

9
$\begingroup$

What are the methods for generating pseudo-random numbers in software?

What are the other methods available for fast pseudo random number generation?

If you don't need to be able to repeat the stream of numbers, there is little reason not to use the methods provided by the operating system - namely, urandom on linux, and CryptGenRandom in Windows. The RDRAND CPU instruction is another option, though it is often times combined with other sources of random number generation, as not everyone trusts it completely (you can ignore this unless you are dead set on obtaining absolutely secure random numbers).

Otherwise, assuming a modern CPU with AES-NI support, nothing will likely be faster then utilizing AES in CTR mode. There is no need to hash the output, this is just eating cycles for no statistical or security benefit.

Why don't people use ISAAC for their implementations?

We can only conjecture at the motivations of others. Some reasons might include:

  • ISAAC is not a hugely well known algorithm in the same tier as AES or salsa20
    • If they are not aware it's existence, they will not use it
  • Their requirements may be satisfied with simpler/more commonly used algorithms
  • Secure random numbers are not always required; Often times, numbers that look random enough work just fine.
  • On the other hand, sometimes security is required, as well as conformance to a particular security standard. ISAAC is not a standardized (read: officially prescribed) algorithm for use as a PRNG by any official organizations i.e. NIST.
    • AES-CTR-DRBG is a standards compliant PRNG.

Is ISAAC not secure enough for cryptographic applications?

The jury appears to be out on this one. There was a reason to prompt the author to design ISAAC+, so while there is no known attack that breaks it outright, it does provide less assurance then a thoroughly reviewed design such as AES or salsa20.

$\endgroup$
10
  • 1
    $\begingroup$ Also note that ISAAC is not NIST-approved as a DRBG and the other approved ones are just fine (especially AES_CTR_DRBG) $\endgroup$
    – SEJPM
    Commented Mar 11, 2017 at 14:21
  • $\begingroup$ Also also note that ISAAC isn't a PRNG is it? It's a steam cipher according to the the majority opinion here. $\endgroup$
    – Paul Uszak
    Commented Mar 11, 2017 at 14:43
  • 3
    $\begingroup$ @PaulUszak A stream cipher is effectively equivalent to a PRNG - simply encrypt a block of all 0s (or a block of anything really, it does not matter). The resultant output is clearly a string of psuedo-random numbers. Additionally, ISAAC appears to be explicitly designed to be used as a PRNG, as was indicated in an accepted answer to a question you asked about the subject. $\endgroup$
    – Ella Rose
    Commented Mar 11, 2017 at 15:02
  • 1
    $\begingroup$ MT is not cryptographic. I acknowledged rdrand does not a prng make. Your intuition forgets all the savings and optimizations that can come from bundling operations in a single specialized instruction. $\endgroup$ Commented Mar 11, 2017 at 21:13
  • 1
    $\begingroup$ @ThomasM.DuBuisson According to the specs from Intel, RDRAND does use a PRNG underneath: With respect to the RNG taxonomy discussed above, the DRNG follows the cascade construction RNG model, using a processor resident entropy source to repeatedly seed a hardware-implemented CSPRNG. Actually it uses CBC-MAC for conditioning the TRNG and then the CTR_DRBG as seeded PRNG. $\endgroup$
    – Maarten Bodewes
    Commented Mar 12, 2017 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.