Original title: science: true random Numbers and pseudorandom Numbers
Source: bitpieteam
Bitcoin users love to talk about esoteric topics like "asymmetric encryption," "elliptic curves," and "quantum computers," and then lose their COINS in a very unintelligible way, like "random."

In the history of many brands of wallet users lost money events, are because of the random function problems.
Randomness is important, especially for cryptographic electronic money like bitcoin. Unfortunately, there is not much discussion about randomness in the community, which leads to a lack of proper understanding among many people. Therefore, today we are going to talk about randomness with you.
When it comes to random, there are two concepts that must be understood: true random number generator (TRNG) and pseudo random number generator (PRNG).
Most of the random functions in computer programs and languages are pseudorandom number generators, which are determined algorithms that produce "random-looking" results through a "seed" (such as "time").
There is no doubt that anyone who knows the algorithm and the seed, or the random Numbers that have been generated before, is likely to get information about the next sequence of random Numbers. Because of their predictability, they are not cryptographically safe, so we call them pseudorandom. This random number, which makes it easy for people to run around in the game, is not safe enough to generate a bitcoin private key.
As for true random number generator, the Chinese wiki equates "hardware random number generator" (HRNG) with true random number generator, which is actually not very accurate. True random in the strict sense may only exist in quantum mechanics, and what we currently want (or could want) is not such random.
We want an unpredictable, statistically safe, cryptographically safe random number, and any random number generator that does that can be called a true random number generator. This is random, is not necessarily is a special design of the hardware, Linux operating system kernel of the random number generator (/ dev/random), maintains a entropy pool (collect hardware noise, such as: keyboard, mouse operation, the network signal intensity changes, etc.), it can provide the greatest possible random data entropy, so also is the high quality of true random number generator.
However, /dev/random is blocked, meaning that if the entropy pool is empty, a read to /dev/random will be suspended until enough ambient noise is collected.
Therefore, when developing the program, we should use /dev/urandom as a copy of /dev/random, which will not block, but whose output entropy may be less than /dev/random.
Well, with all that said, what random number generator should we use to generate the private key when we develop our bitcoin application?
The answer is simple: urandom. Always use urandom.
Don't use any third party random number solutions, even some advanced security libraries, that offer random functions that claim to be "very safe." Since both are user-mode cryptography random number generators, urandom is kernel-mode random number generators. The kernel has access to the entropy of the bare device, and the kernel ensures that the same state is not Shared between applications.
History, countless random failure case, mostly appear in the user mode of random number generator, and the user mode of random number generator is almost always rely on, kernel mode of random number generator (if you don't rely on, the risk is larger), except maybe can simplify your some development work, the slightest don't see any additional benefits, which increases due to the introduction of third-party code, could lead to potential security risks.
Therefore, developers should use urandom when they need cryptographically secure random Numbers.
In the end,Some kids asked, does your BITHD hardware wallet generate true random Numbers?
Here's the answer: of course it is
BITHD's chip has a hardware random number generator, which generates real random Numbers by obtaining a physical noise source, which is unpredictable and undetectable, and is a truly random source.
Source:weixin.qq.com
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia