Skip to main content
Share Your Experience: Take the 2024 Developer Survey
5 votes
Accepted

Does rngd -r /path/to/file inject into /dev/urandom in addition to /dev/random?

On Linux at least, /dev/random and /dev/urandom are basically the same thing; more specifically they are both interfaces to the same internal RNG, called the Linux Random Number Generator (LRNG), that ...
Mike Ounsworth's user avatar
4 votes

An alternative for /dev/urandom

ISAAC says it is based on RC4 (even if it is better than RC4), so AES-CTR will be more secure. Plain RC4 has been disallowed in all secure communication for good reasons. Also, RC4 is only 0.460GB/sec/...
Z.T.'s user avatar
  • 8,514
4 votes

Is it still secure if a cryptographic key generated with OpenSSL while a backdoored HWRNG used?

There's no evidence that Intel's RDRAND instruction set has been backdoored, just speculation based on it being a high-profile target for such attacks, and the known nation-state capabilities of ...
Polynomial's user avatar
  • 135k
4 votes
Accepted

Would `cat /dev/random` be a denial of service to any other users of `/dev/random`?

Yes it would. The blocking random device reads from a single entropy pool and blocks when the entropy estimate goes under a configurable threshold. At this point, any reads from the character device ...
forest's user avatar
  • 66.8k
4 votes
Accepted

Randomly generating invoice IDs

Here's a one-liner that you can use to generate a random string of digits: head /dev/urandom | tr -dc '[:digit:]' | cut -c 1-10 This creates a random string of 10 digits. To increase or decrease the ...
mti2935's user avatar
  • 23.6k
4 votes

Windows .NET equivalent to Linux /dev/random

There is no built-in file-like interface to a source of randomness or entropy, if that is what you mean. Unix-style operating systems such as Linux try to fit everything in a file, but Windows doesn'...
Sjoerd's user avatar
  • 30.8k
3 votes

Feeding entropy pool with my own data

This looks a lot like a XY problem: you want to solve X problem doing Y, but don't know how to do Y, so you are asking about Y here. You are trying to use true secure random numbers and don't trust ...
ThoriumBR's user avatar
  • 54.4k
3 votes
Accepted

Can I use /dev/urandom for generating cryptographic keys?

/dev/urandom is a good choice, but the getrandom system call would be ideal, using the default flags. As for references, this article is not strictly speaking academic but it's a reasonably easy read,...
Luis Casillas's user avatar
3 votes
Accepted

Is reading from /dev/urandom on macOS Catalina a safe way to produce cryptographically secure data?

So, somewhat serendipitously, Apple released an updated platform security guide in December just gone (Dec 2019). Which directly covers random number generation for cryptographic purposes: Random ...
Woodstock's user avatar
  • 689
2 votes

Is pressing random keys a secure way to seed a key generator?

Yes, but that's how you're getting randomness anyway. In Linux and most other operating systems, the exact time in nanoseconds that a key is pressed is recorded and injected into the entropy pool. ...
forest's user avatar
  • 66.8k
1 vote

Is it bad to reveal random bytes from a system?

A secure CSPRNG, like the ones currently and historically used in Linux and most other Unix operating systems, should not leak information from its output. In other words, exposing part of its output ...
bk2204's user avatar
  • 9,504
1 vote
Accepted

Is it still secure if a cryptographic key generated with OpenSSL while a backdoored HWRNG used?

[I assume that your openssl was in the default configuration to pull from /dev/(u)random and not from the HW RNG directly]. tl;dr Short answer: this is a complex topic and depends on a bazillion ...
Mike Ounsworth's user avatar
1 vote
Accepted

Token generation and random numbers

/dev/urandom is the cross-platform solution you're looking for! As @dandavis and @DuncanXSimpson have said, /dev/urandom is perfectly appropriate for this, and will behave the same way across all ...
Mike Ounsworth's user avatar
1 vote

Token generation and random numbers

Yes, /dev/urandom is safe. There is no reason to use /dev/random instead - It's really not safer.
Dessa Simpson's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible