News for hackers. Stuff that matters.
Re:Random Numbers in Bash by ary on Monday March 27, 2023 @11:51AM (#35328230)
> As always, my advice for things like this is that if you’re in need of true random numbers in your shell script then you should probably stop writing whatever it is you are writing as a shell script.

The use of "true" here seems ambiguous.

Does this statement mean that you discourage creation of cryptographic applications with shell scripts, you discourage use of shell scripts to orchestrate applications that use /dev/urandom for any reason, or something else entirely?

Re:Random Numbers in Bash by noam_k on Monday March 27, 2023 @12:02PM (#35328363)
"True random" as opposed to "pseudo random", which is not cryptographically secure.
Re:Random Numbers in Bash by jimktrains2 on Monday March 27, 2023 @12:31PM (#35328753)
There are cryptographically secure pseudorandom generators. In fact all sources non-hardware (i.e. /dev/random and /dev/urandom) are psuedo random as are the keystream generators for most algos that use one.
Re:Random Numbers in Bash by noam_k on Monday March 27, 2023 @01:05PM (#35329221)
TIL. Thanks!
Re:Random Numbers in Bash by ary on Monday March 27, 2023 @01:15PM (#35329379)
Yes, I'm aware of that. The commenter seems to be implying that one should stop using a shell script when one needs "true" random, and I'm curious as to why since one can call out to Perl, Python, etc.

The linked gist doesn't appear to be making the case for using its recommendations in cryptographic applications so what I'm ultimately after is what the commenter thinks is being done in the shell that's inappropriate.

Re:Random Numbers in Bash by MattPalmer1086 on Monday March 27, 2023 @01:41PM (#35329785)
Incorrect. I'm not sure what you mean by "true random", and we could get into some interesting philosophical discussion on that.

However, all software random number generators are pseudo random, including cryptographic ones. They are called CSPRNGs, which stands for Cryptographically Secure Pseudo Random Number Generator.