Questions tagged [random]
UNIX random devices and utilities
237
questions
0
votes
0
answers
53
views
How to know if some linux command uses randomness or say a RNG? [closed]
I know that the ls command uses randomness as what my professor said. But to verify if it does, I need to know a method to check if a program uses some kind of randomness or an RNG?.
-1
votes
3
answers
43
views
Why ubuntu 18 not booting inder vmware?
Image imported from AZURE and converted to VMWARE. Booting stop after few seconds. Can't understanding why...
Very long loading "random:" and no loading more.
3
votes
1
answer
219
views
CSPRNG use on Amazon Linux 2
I need to use a cryptographically strong (certification requirement), which is of high quality (pass industry standard randomness tests) reasonably performant (see below) PRNG.
Originally, I assumed ...
0
votes
1
answer
21
views
Would it be feasible to create a script that can right click the mouse at a very specific location when an even more specific number gets generated?
I'm aware of a program that can simulate a right-click at specific coordinates on my display at any given interval.
However, I'm wondering if it's possible to write a script that can perform a right-...
-1
votes
1
answer
50
views
How to force =RAND() to run only once in LibreOffice Calc?
I am trying to randomize a list of words in LibreOffice Calc. Column A contains numbers 1 to 15, indicating the initial order of the words. Column B contains the words themselves. Here is the original ...
3
votes
2
answers
300
views
Faster wipe hdd with random data
I know that with
dd if=/dev/urandom of=/dev/sdX bs=1M count=hdd_size_in_MB
you can wipe a whole disk with random data. But urandom is very slow. So I wonder if it would be possible to just create ...
0
votes
0
answers
97
views
Fast, cryptographically strong PRNG using /dev/urandom
Edit to make the question more specific:
Can a program just read from /dev/urandom to provide high quality, cryptographically strong random numbers at a rate of at least 1MB/sec on a Ubuntu LTS VM in ...
0
votes
0
answers
28
views
Why Linux kernel randomness is limited? [duplicate]
Why linux kernel has limited size of entropy. If you run cat /proc/sys/kernel/random/poolsize you get 4096. What is that "magic" number and why can't the randomness of the kernel increase ...
1
vote
1
answer
105
views
How to generate random master password?
I want to generate a secure random password for the encrypted Linux system. What offline tools should I use? Any advice if I should use xkcdpass, apg, diceware, or another utility, and how built ...
0
votes
1
answer
371
views
Setting up rngd (randomness generator) on old computers
The rngd program comes from package rng-tools5 on Ubuntu/Debian.
# neofetch
...-:::::-... root@dell-7577
.-MMMMMMMMMMMMMMM-. --------------
...
0
votes
0
answers
307
views
understanding fio test results - 90th percentiles benchmark - Latency --> avg/stdev?
What are the relationships in storage benchmarking with fio between the average(avg) and standard deviation (stdev) at latency?
Avg / stdev at latency is important for sequential or random test?
Most ...
3
votes
2
answers
245
views
reinitialize random to be reinitialized
Printing the $RANDOM variable in zsh is giving me the same result if I don't use it in another context. It's like the shell has a cache of command outputs or variable values so I can't have the new ...
0
votes
1
answer
548
views
random string (variable) generator based on user input
i need to get a script, which will ask user to input a number (from 1 to ....... lets say 100, does not matter), and then based on number entered generate n random strings (aplphanumeric nevermind), ...
0
votes
2
answers
110
views
bash alias to randomly run a command among many
I need help figuring out how to run a bash alias or function that randomly chooses another command or alias and runs it.
the list of commands and aliases and function aliases is known beforehand. the ...
1
vote
0
answers
117
views
Do we still need the haveged daemon with versions of linux after 5.10.119?
Per kernel 5.10.119 caused the values of /proc/sys/kernel/random/entropy_avail and poolsize to be 256
Linux locks the value of /proc/sys/kernel/random/entropy_avail to 256. Do we still need haveged?
1
vote
2
answers
284
views
Random freezes, pointer moves, no response to clicks
Why is my laptop freezing?
Screen randomly freezes, I can move pointer but no response to clicking. Cannot alt-tab through windows.
This happens in firefox and chromium. Ran memtester, all ok. Set FF ...
2
votes
2
answers
1k
views
Fastest way to write bash variable to a file
I want to generate some big files for some experiment.
This is my script. It creates a file then reads it to a variable and then tries to write it as many times defined in the loop in files:
#! /usr/...
4
votes
1
answer
195
views
How Does Linux Generate Random Numbers on Startup
I am currently taking an OS class using XINU, where I am able to control every process running on the OS, and because of this, I can completely predict the output of its random number generator. Here ...
-2
votes
1
answer
130
views
Why is my file with 10 random bytes larger than 10 bytes?
So I have generated a random string of 10 bytes using the command openssl rand -hex 10 > result. My question is why does the resulting file have a size of 21 bytes? I haven't encrypted so I am not ...
2
votes
1
answer
39
views
What is the name of fortuna's kernel process in FreeBSD?
Historically yarrow algorithm had a kernel process with the name of yarrow. But after replacing it with Fortuna, the kernel process disappears.
What is the name of the new kernel process of Fortuna's ...
0
votes
1
answer
206
views
How to avoid duplicate random number generation?
TL;DR:
A program draws the same random seed when started twice simultaneously. How did it happen?
Details
I'm running an MCMC statistical analysis, so I execute the program (phylobayes) twice to get 2 ...
0
votes
1
answer
742
views
Selecting n random files from one directory and copying them to another folder + other files with same same, but different filetype
I have two directories, lets call them X and Y
Within them I have 100k+ files, .jpg files in X and .txt files in Y
I want to randomly select N files from X and copy to folder Z
This should be ...
0
votes
1
answer
90
views
Why does cat randomFile.txt mess up with my terminal? [duplicate]
I am simply generating a pseudo-random content file with.
dd if=/dev/urandom bs=1M count=1 of=./filetone.txt
To then cat it
cat ./fileone.txt
The issue is that upon completing with this command it ...
1
vote
3
answers
96
views
Different $RANDOM results in sed when reading lines in multiple files
I'm trying to run a command that will read multiple files in a directory, look at each line of each file, and whenever it reads a specific string ("gene_height") on any line it replaces 2 ...
2
votes
1
answer
388
views
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 (buster)"
...
21
votes
2
answers
6k
views
kernel 5.10.119 caused the values of /proc/sys/kernel/random/entropy_avail and poolsize to be 256
After update to kernel 5.10.119, /proc/sys/kernel/random/entropy_avail became stuck to 256 and does not change when moving the mouse. It used to be greater than 3000.
# cat /proc/sys/kernel/random/...
0
votes
1
answer
188
views
Won't the new nonblocking architecture for /dev/random make it less secure?
If entropy is not accounted for, and the pool doesn't block even if insufficient entropy has been supplied, isn't it potentially insecure?
21
votes
3
answers
4k
views
How can I force /dev/random to block?
For a class on cryptography, I am trying to drain the entropy pool in Linux (e.g. make /proc/sys/kernel/random/entropy_avail go to 0 and block a command reading from /dev/random) but I can't make it ...
0
votes
1
answer
1k
views
Random float sleep in bash script?
I need randomized pauses in my script between two numbers smaller than 1 second in my script. The following used to work:
#! /bin/bash
sleep $(python -c "import random;print random.uniform(.2,.8)&...
-1
votes
1
answer
502
views
Pick random line from a compressed text file with zcat/gz or altnernatives
I have a simple bash script that picks a random line from a text file. This is originally done with shuf file.txt | head -1 (the same result can be achieved with cat file.txt | shuf | head -1). I also ...
-2
votes
2
answers
155
views
bash error syntax random number [closed]
My assignement is to show a random number (od -vAn -N4 -tu4 < /dev/urandom) between two numbers in read. I don't understand why there are syntax error when I check the min value exception and with ...
4
votes
3
answers
843
views
Random number output between two ranges linked together
This question is about generating random numbers between a range, which is fine, but it doesn't fit my case.
I'll explain in SQL terms because it seems to me that's easier to understand, though the ...
0
votes
3
answers
224
views
How to create a random complex password in SuSe 12
I need a way to generate a random password following this requirements:
Password at least 9 characters
at least 2 capital letters
at least 2 small letters
at least 2 digits
at least 2 special ...
7
votes
2
answers
4k
views
syslog message at boot: uninitialized urandom read
CPU is AMD GX-412TC SOC:
GX-412TC GE412TIYJ44JB 4 6W 2MB 1.0GHz/
1.4GHz N/A N/A DDR-1333 0-90°C
which does not have rdrand:
grep rdrand /proc/cpuinfo
# nothing
I see following messages in my syslog ...
0
votes
0
answers
53
views
How to intentionally minimize the system entropy
My question might seem counter-intuitive at first, as most of the time people want to do the opposite (i.e., increase entropy). I have a few USB devices that act as random number generators -- namely, ...
0
votes
0
answers
197
views
Reading an infinite data in Python and feeding to another external process
I am using Python to read data from a TRNG (true random number generator) device, and I want to feed this data to an external utility (e.g., dieharder). The data itself is an indefinite stream, but ...
2
votes
2
answers
1k
views
How can I configure RANDOM for getting the same 32 bit range of random numbers, like by using SRANDOM?
Environment:
Debian
Bash
What is known:
RANDOM gives a random number in a range of 15 bits by the following:
echo $RANDOM
SRANDOM gives a random number in a range of 32 bits by the following:
echo $...
0
votes
2
answers
1k
views
Putting the contents of /dev/urandom into a variable?
This is a follow on from my previous thread :-
Passing date command into a variable?
Ok so effectively I would like /dev/urandom to generate 4 digits for me. And place them into a variable.
Here is an ...
3
votes
2
answers
579
views
What if I have a bad (static, low entropy) random-seed in systemd?
On embedded systems, read-only filesystems are common. Read-only means that /var/lib/systemd/random-seed cannot be updated on reboot, and is probably a clone of another device's random-seed.
Does this ...
3
votes
3
answers
2k
views
Create Numbers 1-6 in random order using AWK
I'm using AWK to generate values between 1 - 6 which need to come out in random order. I have managed to sort out the logic for the creation of the right range of numbers but am struggling with ...
-4
votes
2
answers
357
views
random output from input
Related question : how to create a random output from users input
I was thinking to take an input(only one argument) from user just like Hello. And, I want to give output like
olleho
llohe
he
llo
lo
...
0
votes
1
answer
171
views
Why is counting repeated numbers from /dev/urandom the same on every system?
This command, which generates numbers from /dev/urandom and prints how many repeated numbers there are, returns the same on every system. Why?
dd if=/dev/urandom count=1 bs=5M 2> /dev/null | od - | ...
-1
votes
1
answer
794
views
Replacing numbers in a text file in each iteration with random values
I have a text file with the following content:
number of apples 7
I would like to run the shell script and modify the number with random values for say 5 iterations. So I need my output to look like ...
2
votes
3
answers
2k
views
How to generate a comma separated list of random ints
I am trying to generate a comma separated unordered list of ints between 1 and 10, I have tried the following but it results in an ordered list:
seq -s "," 10 | shuf
11
votes
2
answers
3k
views
/dev/random EXTREMELY slow in Ubuntu for Windows 10 (WSL)
I am using Ubuntu 20.04 for Windows 10 (WSL2) on a Haswell laptop and I am getting about 0.6 bytes per second. As in 6 bytes total after 10 seconds of waiting. This is unacceptable. What is the ...
1
vote
1
answer
205
views
why reading from `/dev/random` put `1;2c` character behind the cursor? [duplicate]
when I run command dd if=/dev/random count=1 bs=32 I get some random junk binary data but after receiving them, there is still some characters (as I see always 1;2c) after termination of dd process.
[...
0
votes
1
answer
41
views
Seed executables randomization outside of code
We have put in place a features test framework which consists in running our code against some third partie`s pre-existing software. We do so periodically and compare the results with expected results ...
0
votes
2
answers
351
views
How to sample without replacement from a script that randomly extracts 200characters using shuf?
I have this script that extracts 200 random characters from a set:
#!/usr/bin/bash
n=$(stat -c "%s" newfile.txt)
r=$(shuf -i1-"$((n-200+1))" -n1)
< newfile.txt tail -c+"$r&...
0
votes
0
answers
74
views
Could a new AMD processor be limiting dd write speed when using /dev/urandom as the input?
I have recently bought a new computer that uses a pretty recent AMD Athlon chip.
When using it for low-level formatting with dd, I noticed that setting if=/dev/zero allows it to write to the disk at ...
0
votes
1
answer
258
views
How to replace Shuf with rand (from C++) with a seed of time in order to make my script more random [closed]
I have this script that extracts 200 random characters from a set:
tail -n+2 file.fasta | tr -d '\n' > newfile
n=$(stat -c "%s" newfile)
r=$(shuf -i1-"$((n-200+1))" -n1)
newfile ...