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
130
views
Entropy extraction from a Zener diode TRNG
My project is to build a true random number generator that relies on the avalanche effect in a Zener diode. This for a messaging device that uses one-time-pad encryption. Reading about similar ...
2
votes
1
answer
505
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 ...
4
votes
4
answers
3k
views
Given PRNG $G(s)$, why is $G(s) || G(s+1)$ not a PRNG?
I have given a pseudorandom Generator $G(s)$, $|s|=n$ whose expansion $l(n)$ is $>2n$. I also know that $G^\prime(s) := G(s_1,\ldots,s_{\lfloor\frac{n}{2}\rfloor})$ is a pseudorandom generator. Now ...
1
vote
2
answers
60
views
Should I Test A PRNG Using A Fixed Entropy Source For Its Seed?
I want to test a C implementation of Hash_DRBG—which test_demo.c file I will modify to produce random binaries indefinitely to STDOUT as to be used by piping its output—using DIEHARDER for a research. ...
3
votes
1
answer
808
views
Breaking a Mersenne-twister RNG with unsequential outputs
Pardon me for this newbie-ish question. I'm still a novice in cryptography . I have an application that outputs random numbers from 0 - 12 (endpoints inclusive) unsequentially (some outputs are thrown ...
1
vote
3
answers
3k
views
Is it possible to compress a random sequence with high entropy?
I have an algorithm that generates a pseudorandom sequence with a length of 100k and high entropy. I would like to check the quality of its randomness. So, I used a popular software program to ...
0
votes
0
answers
54
views
Security of the trivium stream cipher
So I've been trying to implement a Non-Deterministic RBG based on randomness polling from non-hardware sources (nothing novel, just a side-project). Since collecting entropy and further conditioning ...
5
votes
4
answers
1k
views
How to compute the dataset size required by dieharder tests?
I am trying to use the dieharder random number test suite.
However, this suite requires massive amount of data (this paper claims 228GB for no rewinding for every test) for most of the tests. I'd like ...
5
votes
1
answer
171
views
Conformance of Windows Random Number Generator (SP800-90A) with Key Lifecycle Security Requirements of the BSI
The BSI (Federal Office for Information Security in Germany) has published a paper detailing the requirements of cryptographic modules for certain applications in the energy sector: Key Lifecycle ...
0
votes
1
answer
171
views
Is there a counterpart of /dev/random and /dev/urandom in Windows NT systems?
I am trying to implement a TRNG on Windows and among other entropy sources, I want to extract raw bytes from various kinds of CPU and process info.
As per my knowledge, BCryptGenRandom is a CRNG in ...
1
vote
1
answer
103
views
Manual entropy collection from sources with an arbitrary base
I'm writing a tool for manually collecting entropy from sources like coins and dice, and I'm wondering how to best deal with the case where the desired number of bits of entropy is not representable ...
1
vote
1
answer
240
views
symmetric key generation - random number vs pbkdf2
I am working on improving my grasp on applied cryptography. Following question is just for learning/understanding purposes..
Lets say I want to generate a 16 byte key that I want to use for some ...
1
vote
1
answer
96
views
Can this algorithm be called a RNG?
So I developed this algorithm as RNG, although it looks random to me, I wanted to know the opinion of more experienced persons in the topic.
...
0
votes
1
answer
760
views
How can I recover mersenne twister when only the part of the bits?
https://github.com/tna0y/Python-random-module-cracker
Here, when we get 32*624 bits of outputs from Mersenne-twister we can recover Mersenne twister. My question is when we get the parts of the bits, ...
4
votes
4
answers
199
views
Are TRNGs used in low power devices? Why?
I read somewhere that TRNGs are better than cryptographic algorithms that generate pseudo-random numbers (PRNGs) because these algorithms are more energy intensive than TRNGs.
By low power devices, I ...
9
votes
1
answer
1k
views
Introduction to LLL algorithm applied to linear modular inequalities
What is the Lenstra–Lenstra–Lovász lattice basis reduction algorithm about?
How is it applied to solve for $x\pmod m$ a system of modular inequalities $(u_i\,x+v_i\bmod m)<w$ for $0\le i<n$?
I'm ...
2
votes
1
answer
141
views
Can I predict CryptGenRandom on my own device?
I have a Windows 10 laptop with an algorithm that creates a random number using the PRNG CryptGenRandom. According to Wikipedia:
Because CryptGenRandom is the de facto standard CSPRNG in Win32 ...
4
votes
2
answers
765
views
What are the state-of-the-art TRNGs today?
How fast are the fastest ones? Which ones have the most entropy? Which ones are the most practical ones?
I tried looking for answers on Wikipedia and also, I tried reading papers, but I am couldn’t ...
4
votes
2
answers
193
views
Is it valid to transform the tested sample file and re-test, rather than invent additional randomness tests?
I'm enhancing the venerable ent randomness test suite. And I came across this idea in On Independence and Sensitivity of Statistical Randomness Tests.
"To ...
4
votes
2
answers
1k
views
Optimize the speed of a safe prime finder in C
I am trying to implement the Schnorr’s identification protocol in C. I need a safe prime in order to be able to find a generator of the cyclic group efficiently. The problem is that my program takes ...
1
vote
0
answers
95
views
Can someone give a comprehensive guide on how to run NIST SP 800 90B entropy assessment c code in windows? [closed]
I am trying to run the github code in windows 11. I don't know what all I need to install in my laptop to run the C++ code. It would be a great help if someone can point out the steps to run the code.
2
votes
1
answer
137
views
Is Python secrets module using a unsafe RNG on Windows?
The Python secrets module claims to produce cryptographically secure random numbers. I did some research on which random number generator is used when you call the secrets module on Windows. I found ...
5
votes
2
answers
620
views
Generating X ids on Y offline machines in a short time period without collision
In theory this is what I have :
Around 10 000 offline machines
Each machine will generate around 10 000 ids
I can program the machine in any way I want, but I prefer a low memory and low cpu
They all ...
3
votes
2
answers
104
views
A HRNG that is NIST 800-90 compliant is not suitable for use for OTP generation right?
A HRNG that is NIST 800-90 compliant must use a DRBG in some way regardless of whether it adheres to a RBG1, RBG2 RBG3(XOR), or RBG3(RS) construction. This violates the requirement that the OTP is ...
3
votes
2
answers
597
views
Why does NIST SP 800-90C RBG3 construction require XOR or reseeding a DRBG with a physical entropy source to produce full entropy?
NIST 800-90C defines 3 classes of random bit generation (RBG) constructions: RBG1, RBG2 and RBG3. All constructions must include a DRBG from NIST SP 800-90A. The particular construction in question is ...
3
votes
2
answers
888
views
Trustless, Two-Party Random Number Generation
I've been having trouble with coming up with a random number generator that produces a random number between two parties. My current scheme is this:
User 1 gives user 2 the hash of their randomly ...
0
votes
0
answers
31
views
Academic papers for the pros and cons of password based system and digital signature with challenge and response system
I don't really know what should be the correct title for this and the community can correct it after reading.
I was the author of PKDSA (Searchable on github).
I have the idea to do it because I feel ...
1
vote
0
answers
40
views
How did the VB6 PRNG generate a byte output from a specific seed, and how to replicate in C? [closed]
I'm hoping to get some help regarding an old problem that has eluded me. I'm trying to figure out how the VB6 PRNG was used to generate a byte output from the two byte seed that the Randomize() ...
1
vote
1
answer
109
views
Collision Resistance in Random Bit Generator
Consider following simple RBG where SHA-256 of random noise (more than 200Bytes of 4 bits entropy per byte) is computed to produce 256 output bits
$\text{output} = \operatorname{SHA-256}(\text{...
1
vote
0
answers
74
views
Predicting compromised OpenSSL 3.0 DRBG
The OpenSSL 3.0 rand function's DRBG uses the getrandom() system call to get 48 bytes of secure entropy from the kernel. It also ...
2
votes
1
answer
107
views
theoretical hash collisions vs random number collisions
I have a theoretical question about the probability of collisions of hashes versus random numbers. I'm not interested in the exact probabilities. The exact hash function is not relevant (we can assume ...
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 ...
3
votes
1
answer
116
views
What is the result of not connecting the 1st register to the xor gate in LFSR?
I designed 8 bit lfsr in vhdl. According to mathematical theory, I xor processed the outputs of registers 1, 4, 5, 6 and 8 and connected them to the input of register 1. theory says that if I give the ...
1
vote
0
answers
71
views
Communication through shared seed in RNG
Given that there are two parties, and a process has been conducted by which both parties are knowledgeable of a shared value p, how could two parties communicate with each other over a public channel ...
0
votes
1
answer
130
views
Is a pseudorandom function (PRF) also a one-way function (OWF)? If yes, how can we proof that a PRF $f_k$ is a OWF? If no, what is the closest work?
Let $f_k$ be a PRF. We claim that $f_k$ is a OWF. PROOF let $f_k$ is not a OWF, there exists a $PPT$ algorithm $A$ that can invert $f_k$ with non-negligible advantage. Even if we know the input $x$ ...
10
votes
4
answers
4k
views
Predicting PRNG given some of its previous output
I a have a question about PRNGs and this is my very first experience with them. I have the following generator that takes a 56-bit seed $p$ during initialization and then chooses both $X$ and $Y$ ...
-2
votes
1
answer
177
views
Does a pseudo-random number have the same security as its SHA digest message?
Is a random number generated by a CSRNG equivalently secure as the SHA hash of that number? I know that RNGs generate numbers that look random, and aren't necessarily random. For example, in a range ...
25
votes
1
answer
18k
views
Is openssl rand command cryptographically secure?
I'm wondering if the openssl rand command produces cryptographically secure random bytes. For example when in need for a random password or token:
...
7
votes
8
answers
2k
views
How to generate random numbers within a range (0,n) from random bits?
What is a good method to generate random numbers between 0 and n from random bits?
For example, I have a one million random bits generated according to NIST SP 800 90 publications. Now I need to ...
1
vote
0
answers
48
views
Public seed expansion for uniform reference strings
Many cryptographic protocols are parameterized by a uniformly random reference string (e.g. the commitment key for Pedersen commitments).
Our goal is to publicly generate the random values of this ...
6
votes
1
answer
342
views
How can 4 users generate a provable fair random number?
The past few weeks I have been trying to solve a difficult problem.
I have asked some cryptography experts but unfortunately they had no clue on how to solve the problem.
The situation is as follows, ...
1
vote
0
answers
92
views
Concatenating RNG with PRNG
Is it secure to concatenate numbers from an RNG with numbers from a PRNG? I was thinking to throw a dice and use four outcomes to use as real random numbers, one outcome to change to the next ...
7
votes
1
answer
3k
views
Do I need to use a CSPRNG when creating salts for user accounts?
I'm not sure about the need of using CSPRNG to create salts for each user account.
I found “Cryptographically Secure Pseudo-Random Number Generator in Qt/C++ (Cross platform)” (at StackOverflow) with ...
3
votes
3
answers
470
views
How bad are human-generated random numbers really (One Time Pad)?
This is a pretty open question, so I'm mostly looking for gut reactions from experts more educated than I.
Given these assumptions which are easy to verify with a quick Google search:
One Time Pads ...
2
votes
1
answer
124
views
Any simple, cryptographically secure AES-based DRNG?
I am looking for a DRNG/DRBG (cryptographically secure) algorithm/function (which I can program into js). I am looking to use a DRNG as a seed generator for generating multiple, identical AES keys on ...
0
votes
1
answer
92
views
Pseudo Random Number Generator test uniform distribution
If I test the Pseudo Random Number Generator(PRNG) and it satisfies the serial test, it is not sure that the resulting distribution is uniform. Is my observation correct? If it is correct, what test ...
8
votes
1
answer
1k
views
Secure AES Key Generation via Salsa20?
I am not rolling my own crypto or anything - just trying to learn about
the Dos and Don'ts of cryptography: specifically about AES encryption and
ways to generate keys for that.
As far as I've ...
1
vote
1
answer
85
views
Drawbacks of multiple sources of entropy for AES
Since AES needs IV to be random (unless fed by a unit test), I was wondering how to properly handle it.
I know that Intel/AMD now supports the rdrand64 function but ...
1
vote
1
answer
255
views
NodeJS : Generate unique 16-digit decimal values [closed]
Situation
I need to generate unique 16-digit decimal values in NodeJS API or C++ Addon.
It's used internally in my organization (gift card id). And performance doesn't matter as it's generated non-...
2
votes
1
answer
109
views
How to interpret a formula from the handbook of applied cryptography
In the handbook of applied cryptography, we can find the following formula for testing PRNG. My question is what does mean 2 in the upper index of the ...