Are generated public/private keypair the most random possible?

4

1

The number of possible Bitcoin private/public keypair is very strong (2^160 which is 1,461501637×10⁴⁸).

However, if the random generator is not good enough, only a subset of all that "space" could be used which would considerably break the security of Bitcoin.

That kind of problem has already happened, like that Debian bug in the OpenSSL package.

How can we be sure that random generation is done so it could generated all private/public keypair from the possible "space" ?

paulgreg

Posted 2013-12-21T16:36:58.083

Reputation: 203

Answers

0

Thanks to maschuett’s answer, I looked at the source code and CWallet::GenerateNewKey function calls CKey.MakeNewKey which uses OpenSSL RAND_bytes to generate random number.

Trusting OpenSSL, I think random number generation is secure enough. :-)

paulgreg

Posted 2013-12-21T16:36:58.083

Reputation: 203

1

The source code is open take a look for yourself. I am no expert on cryptography though so I will leave the explanation of this to someone who is. This is the file that you would want to look over https://github.com/bitcoin/bitcoin/blob/master/src/key.h

mschuett

Posted 2013-12-21T16:36:58.083

Reputation: 384

-1

There is a dirt simple, decades old, extremely fast, random number generator that is around ten lines of C code that is extremely random. Orders of magnitude more random and faster than any of the "Numerical Recipes in C". The problem is the technology is export controlled, and thus can't be legally incorporated into an open source code base...

skaht

Posted 2013-12-21T16:36:58.083

Reputation: 2 588

1What is that dirt simple extremely fast random number generator that you’re talking about ? How can that be ? The best random number source are when getting entropy from physical world : number of photons, number of electron, temperature variation and so on. I can’t believe 10 lines of code can do better.paulgreg 2013-12-21T19:01:39.300

No doubt that sensitive Analog to Digital measurements devices measuring white noise KTBW*NF voltages provide a great source for very random numbers, but how much readily available hardware supports that capability? 10 lines of code can't beat that, but it can beat about all the academic so called pseudo random number generators based upon causality.skaht 2013-12-22T06:37:02.840