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
2
votes
2answers
21 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.
-1
votes
0answers
18 views

how to use MT19937RNG generate a random number less than 32 bit? [migrated]

We know that the random module in python use MT19937 to generate a 32-bit random number, for example: ...
2
votes
2answers
69 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 ...
7
votes
1answer
121 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 ...
4
votes
1answer
92 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 ...
3
votes
1answer
110 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 ...
2
votes
1answer
55 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 ...
0
votes
0answers
22 views

NIST Approved Entropy Source List

Per NIST SP 800-90B – Section 3 – Entropy Source Validation : This Recommendation provides requirements for validating an entropy source at a stated entropy rate. Validation consists of testing by an ...
1
vote
1answer
48 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,...
0
votes
2answers
65 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 ...
1
vote
1answer
22 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 ...
30
votes
4answers
7k 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 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 you ...
8
votes
2answers
703 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 ...
1
vote
2answers
152 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 ...
1
vote
1answer
80 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 ...
0
votes
1answer
69 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 ...
1
vote
3answers
85 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 ...
1
vote
1answer
87 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 ...
1
vote
1answer
56 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 ...
2
votes
1answer
104 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 ...
0
votes
0answers
38 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 ...
12
votes
4answers
3k 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 ...
1
vote
0answers
18 views

Default RNG used by openssl for certificate generation [duplicate]

I have generated a certificate using openssl with the below command. ...
1
vote
1answer
84 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 ...
0
votes
0answers
25 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 ...
4
votes
2answers
241 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?
1
vote
1answer
80 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 ...
4
votes
1answer
203 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 ...
1
vote
1answer
60 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: ...
1
vote
2answers
86 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 ...
1
vote
1answer
49 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 ...
2
votes
1answer
51 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 ...
1
vote
0answers
69 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 ...
2
votes
1answer
40 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 ...
-1
votes
1answer
66 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 ...
1
vote
2answers
96 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 ...
2
votes
1answer
138 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 ...
1
vote
3answers
192 views

How can I quickly generate thousands of letters randomly, and strongly mitigate the risk of any compromise?

I want to generate English letters in a truly random manner without resorting to hand-thrown dice, despite their advantages. Rolling dice would be too slow and tiring as I need four thousand letters. ...
0
votes
0answers
24 views

Is there a 'chain-function' which allows computing the value for the index which is next, previous, +/- some constants but has no shortcut for other?

Looking for an algorithm which has a cyclic 'chain'-function which only allows the computation of next, previous element and in addition to that also a shift by a small amount of constants. Example 1 ...
0
votes
1answer
57 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 ...
1
vote
3answers
128 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 ...
0
votes
0answers
38 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 '...
1
vote
1answer
101 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?
0
votes
0answers
32 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 ...
31
votes
6answers
4k 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 ...
0
votes
1answer
69 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 ...
0
votes
1answer
110 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 ...
2
votes
2answers
148 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 ...
2
votes
1answer
72 views

Why does the NIST CTR DRBG apparently output the internal state when no additional input is given?

After reading through the specification of the FIPS CTR_DRBG in SP 800-90A (see Section 10.2.1), I got the impression that the output of the DRBG coincides with its internal state as long as no ...
2
votes
2answers
95 views

Are there any practical differences between running a PRNG on a subset of bits from an RNG compared to running the RNG?

Given an RNG and a PRNG. We define RNG(k) to mean that the RNG produces k random bits. We define PRNG(k, seed) to mean that the PRNG uses seed to produce k pseudo-...

1 2 3 4 5 13