Questions tagged [random]

UNIX random devices and utilities

There are some standard and some less known random devices in Unix systems. The random tag is used to discuss the behavior of these pseudo- and true-random-number-generator (prng, hwrng) devices and the usage of random numbers.

236 questions
230
votes
6 answers

How can I populate a file with random data?

How can I create a new file and fill it with 1 Gigabyte worth of random data? I need this to test some software. I would prefer to use /dev/random or /dev/urandom.
Stefan Lasiewski
  • 19,754
  • 24
  • 70
  • 85
15
votes
2 answers

Why am I getting unevenly-spread results when using $RANDOM?

I read about RNGs on Wikipedia and $RANDOM function on TLDP but it doesn't really explain this result: $ max=$((6*3600)) $ for f in {1..100000}; do echo $(($RANDOM%max/3600)); done | sort | uniq -c 21787 0 22114 1 21933 2 12157 3 10938 4 …
cprn
  • 1,025
12
votes
2 answers

Generate big amount of pseudorandom data predictably

I bought cheep 2 TB HDDs (60 € each) and want to check whether they return the data they were fed when reading before using them. I checked some cheep thumb drives drives by copying large files I had lying around to them and checking the hashes of…
UTF-8
  • 3,237
7
votes
2 answers

Decreasing or emptying the entropy pool?

I work with virtual machines a lot, and they seem to generally be low on entropy (no mouse or other entropy-generating inputs). A bug with my software has surfaced, and I think it's due to running out of entropy. I want to test it, but it only…
3
votes
1 answer

Immediate effect of writing to /dev/random

For reasons best described as philosophical, I'd like to know the following. Assume I am going to read from /dev/random (or /dev/urandom) at time X. In one scenario I just do that, but in another, with /dev/random in the identical state, I push some…
Scott M
  • 355
2
votes
3 answers

Feeding /dev/random with disk reads etc

Is there any way to feed /dev/random with sufficient entropy? The data doesn't have to be truly random, i.e. I can append time of day with pid and add 27 to it, it doesn't matter I just want to make it run faster. I tried to get the ball rolling…
2
votes
1 answer

Different behavior of RANDOM and URANDOM on Rpi Buster

System is: pi@titania:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10…
3john
  • 29
0
votes
1 answer

Increase entropy_avail on Cavium

The device is Octeon by Cavium which contains a RNG hardware unit. OS show Current entropy pool size is 4096 bytes but entropy_avail is very low.The device crypto modules has ansi_cprng.ko present only, no other RNG related .ko present, additionally…