Bitcoin Forum
April 27, 2024, 07:40:45 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: Concern about RNG  (Read 522 times)
NotATether
Legendary
*
Offline Offline

Activity: 1582
Merit: 6695


bitcoincleanup.com / bitmixlist.org


View Profile WWW
March 18, 2021, 07:02:38 PM
Merited by vapourminer (1)
 #21

As far as OS RNG's go, unfortunately /dev/(u)random on a number of systems has multiple instances of insecurity (e.g. see netbsd).  The RNG in Bitcoin core is hardened against weakness of the OS rng by using a hash to combine the OS rng, hardware rngs (if available), and various sources of non-cryptographic entropy (timestamps, network counters, host info, etc.) and passes the result through an computationally expensive hardening function so that even if there is a total failure of cryptographic entropy you still have a fighting chance.

I strongly believe that somebody should make this RNG available for end-users in an external library such as libbitcoinconsensus or at least extract the code into a separate project. It seems very beneficial for secure random number generation.

Even better if it's implemented in an OS-agnostic way such as C/C++, without opening and special files in places like /proc so it can be inserted into Windows/MacOS/Linux/BSD programs at the same time.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
1714246845
Hero Member
*
Offline Offline

Posts: 1714246845

View Profile Personal Message (Offline)

Ignore
1714246845
Reply with quote  #2

1714246845
Report to moderator
1714246845
Hero Member
*
Offline Offline

Posts: 1714246845

View Profile Personal Message (Offline)

Ignore
1714246845
Reply with quote  #2

1714246845
Report to moderator
1714246845
Hero Member
*
Offline Offline

Posts: 1714246845

View Profile Personal Message (Offline)

Ignore
1714246845
Reply with quote  #2

1714246845
Report to moderator
"In a nutshell, the network works like a distributed timestamp server, stamping the first transaction to spend a coin. It takes advantage of the nature of information being easy to spread but hard to stifle." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714246845
Hero Member
*
Offline Offline

Posts: 1714246845

View Profile Personal Message (Offline)

Ignore
1714246845
Reply with quote  #2

1714246845
Report to moderator
1714246845
Hero Member
*
Offline Offline

Posts: 1714246845

View Profile Personal Message (Offline)

Ignore
1714246845
Reply with quote  #2

1714246845
Report to moderator
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4158
Merit: 8382



View Profile WWW
March 19, 2021, 03:54:39 AM
Merited by vapourminer (1)
 #22

I strongly believe that somebody should make this RNG available for end-users in an external library such as libbitcoinconsensus or at least extract the code into a separate project. It seems very beneficial for secure random number generation.

Even better if it's implemented in an OS-agnostic way such as C/C++, without opening and special files in places like /proc so it can be inserted into Windows/MacOS/Linux/BSD programs at the same time.

Unfortunately it's hard to safely implement a RNG in a C-callable and OS agnostic way that is thread safe, fork()ing safe, and being fork/thread safe is pretty important for this sort of thing.   Within Bitcoin Core it's easier because it's all C++ and threading/locking is accomplished in a particular way and the project can guarantee that it's not going to fork() and do something bad.

There are ways to handle fork safely but they're ugly and not particularly portable.

The proc reading stuff is system specific though the code in Bitcoin core already supports handling the normal platforms bitcoin core runs on (linux/windows/osx/openbsd/freebsd/windows/etc.).


Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!