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).

Filter by
Sorted by
Tagged with
8 votes
1 answer
895 views

RFC6979: error in reference implementation?

If I correctly understand RFC 6979, there is an error in the ref implementation section 3.2. In the step H2, RFC specification says ...
cslashm's user avatar
  • 413
6 votes
2 answers
960 views

How to analyze the off-by-one error's impact on the entropy of the result?

I'm reading Jean-Philippe Aumasson's book Serious Cryptography to learn more about cryptography. On page 37, the author gives an example of Cryptocat's off-by-one error in its PRNG implementation in ...
c4mx's user avatar
  • 63
2 votes
1 answer
103 views

Mathematical proof or any reference of "Deterministic random bit generator cannot produce more randomness than the randomness of seed"

The heading tells everything. Any proof or any kind of reference is welcome regarding this: Can we get more randomness from a deterministic random bit generator than the entropy that we feed to the ...
R.Ali's user avatar
  • 21
4 votes
1 answer
231 views

Murder Mystery Party

For a "Murder Mystery Party", one person is chosen anonymously to be the murderer (i.e., only the murderer knows who the murderer is) by shuffling cards with everyone randomly taking a private card (...
bobuhito's user avatar
  • 315
2 votes
1 answer
703 views

Dieharder input file with a sequence of only binary numbers

I have a RNG producing sequences of binary numbers, ad I would like to run Dieharder test using them as an ascii txt input file. However I haven't been able to do it properly. Should I use a header ...
Andrea's user avatar
  • 31
2 votes
2 answers
608 views

Mathematical definition of deterministic and non-deterministic random bit generators

Can anyone give the mathematical definition of deterministic and non-deterministic random bit generator? Providing a reference will also be very helpful.
Radium's user avatar
  • 157
2 votes
2 answers
217 views

Doesn't d6 to binary for 256-bit bitcoin private key generation produce biased results?

If the mapping table looks like: 1: 000 2: 001 3: 010 4: 011 5: 100 6: 101 Then you are guaranteed that your key will never have a chain of 4 or more 1s, much fewer chains of 3 ones than would ...
bulletgirl22's user avatar
8 votes
1 answer
336 views

Distance between consecutive primes distribution

In several prime generation schemes I saw we pick a random number uniformly at random from a wide range and find the next prime after it. Obviously with such a scheme some primes are more likely than ...
Meir Maor's user avatar
  • 11.7k
4 votes
1 answer
244 views

Can a PRNG be made into a CSPRNG by hashing the outputs?

So I was contemplating this answer to my last question, and it got me thinking: If I understand it right, one of the required properties of a CSPRNG is that it resists leaking information about its ...
mtraceur's user avatar
  • 289
4 votes
1 answer
540 views

Is the PCG PRNG a CSPRNG, or why not?

Is the PCG family of PRNG algorithms cryptographically secure, and if not, what about them makes them inadequate for that? I have a good enough understanding of the general problem space that if you ...
mtraceur's user avatar
  • 289
2 votes
1 answer
81 views

Faster Shuffling for a Simple Application

Alice, Bob, and Charlie are working on three projects. Alice is the manager. At the beginning of each day, she chooses one project to work on (this choice is based on her preferences and is not ...
bobuhito's user avatar
  • 315
1 vote
1 answer
257 views

Min Entropy Value for Health Test per NIST 800-90B for 32 bit Noise Source

NIST 800-90B recommends Section 4.4.1 Repetition Count Test & Adaptive Proportion Test for health test on Noise sources. In the equation to calculate the cut-off value C for Repetition Count Test,...
trendzTwister's user avatar
0 votes
2 answers
415 views

PRNG next bit test

I would like to know whether a specific PRNG satisfy the next-bit test or not. will satisfying all of NIST statistical tests on PRNG guarantees passing the next-bit test? Or is there a specific ...
Tararu's user avatar
  • 15
1 vote
1 answer
33 views

Does concatinating mutliple digests of hashes from CSRN result in a CSRN?

Kind of a noob question. Suppose; We generate 1,000 cryptographic-ally secure random numbers & store each of them in an array1. For each number in this array1, we take the hash sha256(CSRN) then ...
M4X_'s user avatar
  • 145
35 votes
5 answers
12k views

The GCD strikes back to RSA in 2019 - Good randomness is the only solution?

When someone collects lots of RSA public modulus, the first thing that comes to mind is; $$\text{GCD them all}$$ If you calculate the GCD of two different RSA modulus and if the result is not 1 then ...
kelalaka's user avatar
  • 47.6k
10 votes
3 answers
1k views

Perfect shuffle possible with limited raw entropy?

I am trying to shuffle a standard 52-card deck in a perfect way (every outcome should be possible at an equal chance). I am not, at this point, concerned with cryptanalysis attacks against it. I have ...
RokL's user avatar
  • 211
1 vote
2 answers
799 views

The importance of randomness in the creation of a key

Why does it matter what kind of random number generation is used during key generation? E.g. this answer states ...
Haukinger's user avatar
  • 119
1 vote
1 answer
96 views

Creating Random Pad from XORed Sections of Pi

If two strings of equal length from random offsets in Pi were XORed together, would this result in a cryptographically secure random number suitable for use in a one-time pad? If so, would this mean ...
user4372's user avatar
0 votes
1 answer
226 views

PRNG XOR Pipeline

For an OTP I need the 'best' random data I can acquire. Please check if my thinking for stacking PRNGs together in a pipeline can only make the output statistically better, never worse?! So take a ...
Jet Set Willy's user avatar
1 vote
3 answers
814 views

Should the seed of CSPRNG produce the same random number?

Assume we are designing a CSPRNG to be used in encryption like that used for ECC-based cryptography. Is it required that the seed always produces the same random number always? Or should it be ...
Tararu's user avatar
  • 15
1 vote
1 answer
140 views

What is the weakpoint of PRNG based encryption? [closed]

Let's say I used this encryption schema: In words instead of images: Hash the encryption key with SHA256 Split it in half, first half use as XOR key for first 128 bit block of plaintext Hash the ...
Kryštof Vosyka's user avatar
1 vote
1 answer
820 views

Is it possible to recover the seed value from a Mersenne Twister PRNG state?

So I know that you can recover the state of a mersenne twister generator by observing a sequence which is long enough. I was wondering if you could be able to recover the actual seed value used or ...
user avatar
3 votes
1 answer
263 views

Strong RNG for encryption/authentation algo

I saw in the market several hardware options for creating strong RNG to produce strong KEYS: HSM TPM internal TRNG Intel RDSEED (TRNG)/RDRAND My questions are; What is the strength/entropy ...
Offir's user avatar
  • 283
0 votes
0 answers
76 views

using non prime numbers in Blum Blum Shub or Blum Micali

I would like to use Blum Blum Shub, or Blum Micali methods as random number generators only. I am not interested in their encryption capabilities. I was wondering, if I replaced the prime numbers ...
Tararu's user avatar
  • 15
17 votes
4 answers
7k views

Can we use a Cryptographic hash function to generate infinite random numbers?

I have seen that there are PRNG that can generate a specific number of random-numbers. The Mersenne Twister as an example, can generate 2**19937 (if I'm not wrong) but... can we use a cryptographic ...
Alexandro Babonoyaba's user avatar
1 vote
0 answers
27 views

Default RNG used by openssl for certificate generation [duplicate]

I have generated a certificate using openssl with the below command. ...
Kannan Ramamoorthy's user avatar
1 vote
1 answer
101 views

What is the difference between $\in$ and $\in_{\small R}$?

I have a simple question about basic math. When I read different papers bout ABE, I see different methods to choose a random exponent. What is the difference between the following options? Choose a ...
tesoke's user avatar
  • 181
0 votes
0 answers
315 views

How is Pre Master Secret related to Client.random or Server.random if DH KEX is RSA

For TLS 1.2 cipher Suite AES256-GCM-SHA384, RSA is KEX(key exchagne algorithm). As per standards of RSA Diffie Hellman KEX, after 'ServerHello' message client gets server certificate and it generates ...
Genie's user avatar
  • 63
5 votes
2 answers
506 views

What are usable entropy sources in a headless machine without /dev/random or any cryptography API?

If I have a headless machine (no mouse movements, no keyboard presses, or user input), without any cryptography CSPRNG APIs, where can I collect entropy from?
09182736471890's user avatar
1 vote
1 answer
773 views

Can the OpenSSL random number generator be considered cryptographically secure? [duplicate]

The OpenSSL Random Number generator documented here uses an OS-provided entropy source coupled with a MD5 hash function. Does it impact the quality of randomness to use a broken cryptographic hash ...
d-stroyer's user avatar
  • 113
4 votes
1 answer
268 views

Any speed up methods for finding the index of a random value produced by the Inversive congruential generator?

The Inversive congruential generator produces random values with: $$x_{n+1} = a\cdot x_{n}^{-1} + b \mod P$$ (special case if $x_n=0$ -> $x_{n+1}=b$) starting with an initial value $x_0$ With well ...
J. Doe's user avatar
  • 573
1 vote
1 answer
638 views

What is the correct way to choose the start parameters for NIST tests? [duplicate]

I had an idea of creating a pseudo-random binary sequence with that code: ...
reogeo's user avatar
  • 15
1 vote
2 answers
170 views

Is it possible to use an algorithm to generate an OTP?

I am a software developer, not a cryptologist. I like the idea of perfect secrecy and would like to use a one-time pad (OTP) to encrypt/decrypt files up to, say, 50Mb. Is there a way that I can use ...
DatsunBing's user avatar
1 vote
1 answer
283 views

Problem with Hash-DRBG's seedlen values (and others)

In NIST-SP-800-90Ar1, the Hash-DRBG is instantiated with hash functions using strange values for seed length (seedlen) such as 440, 888. How are these values derived? How to derive values for other ...
DannyNiu's user avatar
  • 9,001
2 votes
1 answer
156 views

NIST DRBG algorithms' optional parameter

As I'm going through NIST-SP-800-90Ar1 spec for DRBG, I found the mention of security_strength in all of the 3 specified construct in the document: Hash_DRBG, HMAC_DRBG, CTR_DRBG. However, they're all ...
DannyNiu's user avatar
  • 9,001
1 vote
0 answers
78 views

'random' function $r_{n+1} = f(r_n)$, $|\{r_i,\forall i\}|=N$, $r_N = r_1$ where a function $g(r_k)=k$ is harder than in ECC?

Is there a deterministic pseudo random function $f$ with $r_{n+1} = f(r_n)$, $|\{r_i,\forall i\}|=N$, $r_N = r_0$, (for given random initial value $r_0$) where a function which derives the index of a ...
J. Doe's user avatar
  • 573
2 votes
1 answer
78 views

Randomness measure of a sequence over a finite set [duplicate]

If $S$ is a finite set (such as outcomes of a dice). If I have a sequence $x_0 ... x_n$ of elements over $S$, how can I measure randomness quality of such a sequence as compared to measuring quality ...
Viren Sule's user avatar
-1 votes
1 answer
94 views

Is a number generator based on hashing an incremental string and a seed considered random? Part 2

Sorry I didn't put enough details on my last question, I didn't expect that there is really lots of factors, so most answers were left for speculations. In this question, I will give the scenario I am ...
Mocas's user avatar
  • 113
1 vote
2 answers
395 views

Is a number generator based on hashing an incremental string considered random?

Consider the following system 1 - fixed string as a seed, example "something" 2 - concat an increment number "something-1" 3 - hash it, assume it is "9f2054ea4d2c" 4 - take the first 3 digits to ...
Mocas's user avatar
  • 113
2 votes
1 answer
621 views

"Jitterentropy" vs CPU RDRAND in VeraCrypt 1.24

Veracrypt 1.24 just came out. It uses a true random number generator based on hardware events; namely, on CPU timing jitter, or "Jitterentropy". As an alternative to CPU RDRAND, I am a bit jittery ...
Patriot's user avatar
  • 3,112
1 vote
4 answers
395 views

How can Bob quickly generate thousands of letters randomly while strongly mitigating the risk of compromise?

Bob wants to generate four thousand English letters for a proper one-time pad without resorting to hand-thrown dice, despite the advantages. Rolling dice would be too slow and tiresome. Bob does not ...
Patriot's user avatar
  • 3,112
0 votes
1 answer
310 views

What PRG expansion factors are safe?

I'm trying to better understand the "cost" of randomness usage/generation in practice. I understand that generally, some (small) amount of "true" randomness is generated, and then a CSPRNG is applied ...
Mark's user avatar
  • 11.6k
1 vote
4 answers
786 views

Why does mt19937 fail the universal test in NIST SP 800-22?

Update: with the help of @SqueamishOssifrage and @PaulUzdak, we discovered that my NIST SP 800-22 has a broken universal test. So this becomes a moot question. Check this report. It seems to sail ...
user45491's user avatar
  • 409
0 votes
0 answers
69 views

Do any block cipher encryption functions (or similar functions) exist which are associative to each other and cyclic?

Most block ciphers encrypt a plaintext deterministically into a ciphertext which allows decryption in the opposite direction. Now, instead of encrypting just one plaintext, I'm looking for a cyclic '...
J. Doe's user avatar
  • 573
2 votes
1 answer
477 views

What is the most secure/reliable CSPRNG currently available? [closed]

In terms of period length, uniformity/distribution, what is the most secure/reliable CSPRNG currently available?
FzpX's user avatar
  • 39
1 vote
0 answers
43 views

Help, Feedback and Solutions to a problem on a PoC CSPRNG

Background I do not recommend trying to roll your own crypto. This is just a for-fun PoC, which won't be used in any public or private scenario. I am creating a PoC nearly-true random number ...
Display Name's user avatar
32 votes
6 answers
5k views

What is the practical impact of using System.Random which is not cryptographically random?

I recently noticed a .NET software using PBKDF to derive an encryption key from a password string. This password string was ...
learnerX's user avatar
  • 687
0 votes
1 answer
125 views

How can I estimate the amount of entropy (with JavaScript) that I'm seeding a CSPRNG with?

I am trying to determine how much entropy is going into a specific CSPRNG in JavaScript, but I can't seem to find a pure-JS client-side implementation of an entropy estimator. So, I need to find a ...
Display Name's user avatar
0 votes
1 answer
921 views

Different ways of building a ChaCha20-based RNG

Let's say you're building RNG with ChaCha20 and the fast key erasure technique. There seem to be a few ways to do it. The reference implementation in the SUPERCOP benchmarking toolkit looks like ...
Kannan Goundan's user avatar
2 votes
2 answers
227 views

Efficient way of generating a random number of N (less than 64) bits with exactly M bits equal to one [closed]

Would there be an efficient way to implement a function with the following signature: unsigned long long int random_word(size_t n, size_t m) that would generate ...
Vincent's user avatar
  • 121

1
3 4
5
6 7
17