Bitcoin Forum
May 07, 2024, 03:28:39 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 526 times)
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6730


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
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
1715095719
Hero Member
*
Offline Offline

Posts: 1715095719

View Profile Personal Message (Offline)

Ignore
1715095719
Reply with quote  #2

1715095719
Report to moderator
TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715095719
Hero Member
*
Offline Offline

Posts: 1715095719

View Profile Personal Message (Offline)

Ignore
1715095719
Reply with quote  #2

1715095719
Report to moderator
1715095719
Hero Member
*
Offline Offline

Posts: 1715095719

View Profile Personal Message (Offline)

Ignore
1715095719
Reply with quote  #2

1715095719
Report to moderator
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4158
Merit: 8411



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!