Questions tagged [random-number-generator]
A random number generator is a software or hardware solution which functions as a generator of (real or pseudo) random numbers (or bits).
830
questions
2
votes
1
answer
118
views
exact meaning of ntup in dieharder tests
I'm working with the dieharder package to test a PRNG, but I don't quite understand the ntup parameter.
I get that the ntuple should be a set of consecutive bits. ...
0
votes
0
answers
38
views
Hash function adapted to work as bactracking resistant PRNG
Let's consider PRNG which is updating its state by using some cryptographically secure hash function. So it takes some input, returns output and this output is a new input. And so on.
Of course there ...
1
vote
1
answer
160
views
Bactracking resistance PRNG - real world usage
I read about bactracking resistance:
http://cs.yale.edu/publications/techreports/tr1466.pdf
https://arxiv.org/pdf/1810.02227.pdf
https://www.schneier.com/wp-content/uploads/2017/10/paper-prngs.pdf
...
0
votes
0
answers
59
views
Check security of random byte generator
How can I check if the random number generator library that I am using for my app is cryptographically secure or not?
1
vote
0
answers
84
views
Cracking a LCG with tricky parameters
I'm given three values $s_0,s_1,s_2 \in \mathbb{Z}_m$ that follows the recursion formular $s_{n+1} = as_n+b \mod m$.
I know $m$ and want to calculate $a,b$. It's easy to see that $a=\frac{s_1-s_2}{s_0-...
0
votes
1
answer
176
views
Secure Random number generator
I am trying to implement a random number generator (which should be cryptographically secure), I am thinking of combining multiple LFSRs, is it a good choice?
I've also heard I can create RNGs from ...
0
votes
1
answer
156
views
Seed of pseudo-random number generators
How is the seed of PRNGs generated? They can't be hardcoded I am guessing.
1
vote
1
answer
2k
views
Should we really rely on "Cryptographically Secure Pseudo-Random Number Generators" (CSPRNG) alone to guarantee secure random output?
Would it be over-engineering to for example hash the random numbers a random amount of times too, for instance when using the CSPRNG in client-side JavaScript? (assuming this is not the strongest ...
1
vote
0
answers
32
views
Practical demonstration of random number [closed]
I am tasked with creating a practical demonstration of a random number.
This means, generating a random number, then showing something practical with it.
Does anyone happen to know something practical ...
1
vote
2
answers
150
views
Does the p value in randomness tests provide any real value?
In the dieharder test suite there are things like:-
diehard_3dsphere| 3| 4000| 100|0.56011310| PASSED
and in the NIST IID (brief mode) and randomness ...
16
votes
4
answers
5k
views
Is there a cryptographic algorithm that can make a "lottery ticket"?
With public-key cryptography, I know Alice can "seal" a message that only Bob can open. But in that case, Alice knows the message that she is sealing.
What if Alice wants to seal a random ...
2
votes
1
answer
249
views
Uniform rejection sampling by shifting or rotating bits from CSPRNG output, safe?
Given a CSPRNG (arc4random, using ChaCha20 keystream), one want to use rejection sampling to get random number on a smaller range avoiding modulo bias (arc4random_uniform()).
OpenBSD's ...
0
votes
1
answer
127
views
ChaCha Single-Use RNG with All Zero Plaintext + Nonce
I am creating an internal application that will be used to generate and manage self-signed certificates and certificate authorities. Its primary use will be for generating certificates used in SSL ...
6
votes
3
answers
226
views
Are small domain keyed permutations inherently unsafe?
In the accepted answer to a question in Computer Science Stack Exchange, it was mentioned that a block cipher in counter mode makes a random number generator with a large bitspace, which visits every ...
0
votes
2
answers
164
views
CS(P)RNG uniqueness
I recently read a StackOverflow post about a CS(P)RNG generating sixteen bytes of random data. The OP wanted this data to be random and unique. One of the answers said that uniqueness and randomness ...
1
vote
1
answer
231
views
Predicting the next output of Java Random with bound of 32
I'm trying to predict the next output of random numbers (bounded from 0 to 32) generated by the java.util.Random class. The code is shown below:
...
2
votes
1
answer
94
views
Dieharder tests on ATmega328p floating analogue pin A0 passing unexpectedly
Out of interest I wanted to test the results of using a floating analogue pin on my Arduino to generate a sequence of random numbers using dieharder.
My working assumption was that it would be a poor ...
1
vote
1
answer
77
views
What's the best approach to make PRNGs favourably deterministic a.k.a. biased and how to protect yourself against this?
First of all, I'm not an expert or even a novice in Cryptography.
I mean this has certainly been implemented by some scummy PRNG developers, which thought of the economics behind it (especially in the ...
0
votes
1
answer
254
views
Using system time in nano-seconds as source of entropy in a smart contract
I am working on a smart-contract to be deployed on ETH chain.
I am using an oracle(not the company!) system to get the information from off-chain (outside of the blockchain). Basically, we can think ...
0
votes
1
answer
506
views
Is Mersenne Twister hard to break if it has a reduced output?
I was reading this challenge, which proposes to clone (or recover) the internal state of the MT19937 just by applying the inverse process to each output (624 consecutively words).
Mersenne Twister's ...
0
votes
1
answer
136
views
Is this pseudo random function any good and/or original? [closed]
I designed this pseudo-random function algorithm that takes a uint64 and returns a uint64. I'd like to know if it is any good ...
4
votes
3
answers
945
views
Hotbits vs. Random.org vs. Anything else?
I was searching for a random seed to use with a pseudo-random number generator (not trying to encrypt anything). I went to the following web sites:
https://www.fourmilab.ch/hotbits/secure_generate....
1
vote
1
answer
67
views
About two sequence conversion methods in NIST 800-90B
I am reading the 800-90B document.
In particular, I'm looking at Chapter 5, the chapter on checking that samples conform to IID.
There are 11 tests such as Excursion Test Statistic and Number of ...
2
votes
1
answer
181
views
Observations about ENT's Chi Squared test on my own RNG—and HotBits's score
Basic question: ENT seems to trip up generators that pass NIST 800-22 and maybe even dieharder. How do the latter two test suites miss such an obvious failure?
There are two things I want to mention ...
0
votes
0
answers
94
views
Synchronized random number generation
Let me try to reformulate the problem, as it might help a bit. The requirements are the following:
At the beginning of their connection, the two end-points perform a Diffie-Hellman to derive with a ...
2
votes
1
answer
308
views
Why does the von Neumann corrector only work when the input bits are independent of each other and same bias?
I read some papers that mention the von Neumann corrector. They always assume that for the von Neumann corrector, the input bits are independent of each other and same bias
Why does the von Neumann ...
1
vote
0
answers
121
views
Show that block cipher with CTR is a good PRNG
Assume that block cipher scheme $(KeyGen, Enc, Dec)$ is CPA-secure. Show that $CTR_{Enc_k(0^n)}$ is a good PRNG.
Counter mode works as follows:
$Y_i = Enc_k(IV + f(i))$
$C_i = Y_i \bigoplus P_i = Y_i \...
2
votes
1
answer
244
views
How less secure were those random bytes?
In our Python codebase, some random bytes were generated that we wanted to be cryptographically secure. Previously, the code was:
...
0
votes
0
answers
265
views
recover private keys (RSA)generated with weak LCG
How is it possible to recover RSA private keys considering that weak LCG (random number generator) is used?
I have some other keys (Public and private created with the same generator) and also some ...
2
votes
1
answer
109
views
What is the methodology for selecting symbol bit length and window size when performing Shannon Entropy Analysis?
When performing Shannon Entropy analysis on something like an RNG or a file, you must:
Select a symbol bit length and number of samples would will perform analysis on at a time (IE: windows size)
...
2
votes
1
answer
499
views
Input size recomendation of sequence for each test in NIST SP 800-22
I am using the NIST SP 800-22 to evaluate the performance of the Random Number Generator.
NIST SP 800-22 has a total of 15 tests. In each test, it has a recommendation for the size of the tested ...
0
votes
0
answers
85
views
Enumerating values from a linear congruential generator java Random()
During my research on a java application, I discovered that the nextInt(64) function of the java.Random() class is used to ...
0
votes
0
answers
36
views
Only DRBG is used for PGP or could use other PRNG?
-RFC4880 refer to DRBG at https://www.rfc-editor.org/rfc/rfc4880#section-16.2
-Could we apply other PRNG such as enocoro/photon for pgp?
2
votes
1
answer
117
views
Probability of getting same result from /dev/{u}random
What is the likelihood of getting the same result from /dev/random?
1
vote
1
answer
122
views
Why the DRBG can mask the small deviations in the behavior of the entropy source?
In NIST SP 800-90C, it said:"Small deviations in the behavior of the entropy source in an NRBG will be masked by the DRBG output"
Why the DRBG can mask the small deviations in the behavior ...
1
vote
1
answer
112
views
Can we apply the Pseudo Random Number (PRNG) as post processing method for True Random Number (TRNG)?
From the NIST SP 800-90B, we can use these cryptographic algorithms (HMAC, AES, Hash function) as a post-processing technique for TRNG.
Besides that, can we apply the Pseudo Random Number (PRNG) as a ...
2
votes
1
answer
351
views
Post processing method for True Random Number Generator
I am finding the post-processing method to improve the randomness of the True Random Number Generator. Especially, TRNG can pass the NIST SP 800-22 after applying the post-processing.
I tried to apply ...
1
vote
0
answers
47
views
What is the security of XORing SHAKE256_XOF with itself?
After reading "Can the xor of two RNG outputs ever be less secure than one of them?" I wondered if you can increase security of SHAKE256_XOF by using ...
1
vote
1
answer
62
views
About some tests in NIST SP 800-22 rev 1a and erfc function
I'm learning the randomness test of the NIST SP 800-22 rev 1a documentation.
https://csrc.nist.gov/publications/detail/sp/800-22/rev-1a/final
As I was reading, a few questions came up and I put them ...
0
votes
1
answer
130
views
What would be the benefits of a fast PRNG that produces an 8-bit output and could pass 1 Peta Byte of the PractRand test?
Assuming that all other elements like the internal state of the algorithm are considered secured and very hard to discover from a cryptanalytic standpoint.
How significant would be for the algorithm ...
1
vote
1
answer
90
views
How to draw words randomly from a physical dictionary?
Suppose I have a real physical dictionary, and I want to draw words from it randomly, using dices. How should I do it?
Maybe it's easier to work with a coin since it's easier to convert binary to a ...
0
votes
0
answers
255
views
Does xoshiro/xoroshiro PRNGs provide uniform distribution?
It's not clear from the documentation if the sequence of integers produced by these PRNGs belongs to the uniform distribution.
Also it's look like there is a whole family of RNG algorithms called in a ...
1
vote
1
answer
131
views
Trimming uniformly random input for elliptic curve private keys
Imagine there is 256-bit uniform input from CSPRNG. Suppose there is a curve like secp256r1 whose curve order is slightly less than 256 bits.
We cannot just ...
2
votes
3
answers
228
views
Two untrusting people want to come up with a random number
Two people want to come up with a random number. They don't trust each other nor any third party. What are the known solutions to this problem?
I am a quantum cryptography student and am currently ...
2
votes
1
answer
383
views
Benefits of hashing a particular seed in a PRNG
This question is linked with this question (stackoverflow) where I asked about a specific implementation detail of Python's random number generator (Mersenne Twister). Here, I have a slightly ...
1
vote
3
answers
331
views
Truly Random Numbers at Scale - Overloaded memory chips generate truly random numbers for encryption
For years, truly random numbers at scale has been elusive. Thus I read this recent research https://www.newscientist.com/article/2303984-overloaded-memory-chips-generate-truly-random-numbers-for-...
2
votes
2
answers
212
views
Is it possible that PracRand did not detect looping of the generator?
I'm testing my own PRNG generator which should has period $2^{38}$ bytes. So after exactly $2^{38}$ bytes it should start repeat. But PractRand find no anomalies after $2^{39}$ bytes.
Could it be that ...
2
votes
1
answer
114
views
Exponentiation of Linear Congruential Generators
Linear Congruential Generators, that class of pseudo random generators with recursive rule
$x_{n+1}\equiv a\cdot x_n +b\ \ (\mod m)$, $a,b,x_n\in Z/mZ$, $m,n\in N$
are considered inapt for use in ...
0
votes
1
answer
1k
views
Where is the specification for SHA1PRNG?
I searched for the algorithm of the SHA1PRNG, which is implemented in Java's SecureRandom Class. Does anyone know how this algorithm works exactly? I have not found a source where the algorithm is ...
2
votes
1
answer
126
views
Average spectral score of multiplier in LCG
LCGs have a property that when plotted in 2 or more dimensions, lines or hyperplanes will form, on which all possible outputs can be found.[2] The spectral test compares the distance between these ...