You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perl's rand is not even remotely cryptographically-secure.
This should probably use, at minimum, Bitcoin::Util::randInt. And it would probably be better for Bitcoin::Util::randInt to use Bytes::Random::Secure or similar instead of its custom thing.
The text was updated successfully, but these errors were encountered:
In particular, from a quick glance through the Perl source, rand is seeded with only 4 bytes. Which means libbitcoin-perl will, on first invocation, generate one of only 4 billion different keys.
jes
added a commit
to jes/libbitcoin-perl
that referenced
this issue
Aug 28, 2016
Perl's built-in rand is not cryptographically-secure. In particular,
it is only seeded with 4 bytes of entropy.
Bitcoin::Util::randInt appears to be an improvement but also hasn't
been properly analysed.
I wrote a program that simply generates and prints a private key. I ran it 1.3 million times, and of the 1.3 million keys, 219 appeared twice. This is not safe.
Perl's rand is not even remotely cryptographically-secure.
This should probably use, at minimum, Bitcoin::Util::randInt. And it would probably be better for Bitcoin::Util::randInt to use Bytes::Random::Secure or similar instead of its custom thing.
The text was updated successfully, but these errors were encountered: