Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

1
vote
2answers
48 views

Choosing a Random Number Generator algorithm to encrypt a message

What are the best cryptographically secure pseudo-random number generator algorithms, and what are their strengths/weaknesses? I can't seem to come up with a list of them (or maybe I do, but they ...
5
votes
3answers
2k views

Cryptography's random number problem?

Sophie Chen at Wired Magazine; quantum mechanics could solve cryptography's random number problem Such machine already exist, but it's too huge and not so fast in order to use it all the time. ...
2
votes
0answers
43 views

Do any bits from the standard Mersenne Twister repeat more often than the total period?

While the total period of MT19937 is $2^{19937}-1$ by design, is the period of the sequence of any of the individual bits from the output less than this? I'll admit I'm far too unfamiliar with group ...
1
vote
1answer
42 views

Interpretation of (NIST) Non Overlapping Template Matching Test

Regarding the Non-Overlapping Template test, this test normally gives us a bunch of p-values (148 values). I would like to ask that how do we interpret those values into a single p-value for ...
0
votes
0answers
57 views

Analyzing random number generators using NIST tests vs. machine learning

I was wondering if passing the NIST tests is a good indicator of being a random number generator. I have a set of numbers that pass NIST tests, but I can predict the next number using machine ...
1
vote
2answers
71 views

Is it possible to test 15-bit PRNG with the library TestU01?

The library TestU01 inconvenient for generators that don't produce 32-bit outputs. But is it possible to somehow test say a 15-bit generator with it? How could that be done? For instance, the ...
0
votes
2answers
84 views

Blockchain cryptography

I'm a high school student doing a project about blockchain. I'm trying to figure out why hashing algorithms are crucial for the existence of blockchain and other types of cryptography wouldn't work. ...
1
vote
0answers
13 views

How to choose between password derivation or encryption? [migrated]

Suppose you use a password manager having all possible features of modern password managers: encryption with a key derived from your master password, auto-filling, cloud or local storage, browser ...
0
votes
1answer
92 views

How might one create a system of election by lot (sortition) that is both secure and verifiable?

I've been puzzling recently over sortition, a democratic method of selection for public office which I find very fascinating. Basically, instead of choosing candidates like Hillary Clinton or Donald ...
5
votes
1answer
2k views

Do hash functions need to “look random”?

I've noticed that looking random is not often listed as a requirement for a good hash function in the same way that preimage or collision resistance is. Do we need hash functions to look random? ...
15
votes
2answers
1k views

What is the difference between TRNG and CSPRNG?

I understand the output of a TRNG is almost impossible to reproduce, such a flipping a coin 100 times to produce a 100-bit sequence. However, it is also my understanding that a CSPRNG produces an ...
2
votes
1answer
96 views

Making PRNG cryptographically secure thru shuffling?

Is it practical to make a PRNG cryptographically secure if I shuffle the randomly generated numbers (say 256-bit) several times before hashing it, even if a hacker knows when I generate the numbers? ...
3
votes
1answer
200 views

Is SHA1 secured enough as a PRNG

I read SHA1 is still a secured hashing function with no collision found as of now. However, it's just a matter of time for someone to come up with such a collision or attack. Therefore, in new ...
1
vote
2answers
63 views

Encryption using deterministic CSPRNG as secure as CSPRNG

As a beginner it seems that a scheme derived from a CSPRNG should be as secure as that CSPRNG. Is this a correct assumption? Are there restrictions or known special cases? A rough outline would be: ...
0
votes
1answer
87 views

Does hashing a PRNG by a cryptographically secure hashing algorithm result in a CSPRNG?

Or specifically, does ChaCha20 hashing of the xoroshiro128+ random number generator result in a cryptographically secure random number generator?
0
votes
1answer
63 views

python secrets security evaluation [closed]

The python library secrets gives a title as; "Secrets - Generate secure random numbers for managing secrets" and makes a distinction from "random module" by In particularly, secrets should be ...
1
vote
1answer
86 views

How to generate tokens from a secret key?

The problem is simple: I want to be able to spit out 256-bit "tokens" that only I could've produced because I know my secret key $s$, and given any number of these tokens, no one can figure what $s$ ...
1
vote
0answers
42 views

Mersenne Twister's vulnerabilty with small-size distributions

C++ rookie here, trying to wrap his head around (CS)PRNGs. I (assume that I) already understand the concept of the Mersenne Twister being "broken" (i.e. not cryptographically secure) due to its ...
3
votes
1answer
55 views

Randomizing Prime Field Elements

I need my code to generate random elements from $GF(p)$ ($F_p$ or $Z_p$, if you will). The Crypto API I have available provides one with random bit strings. To tailor that to my needs, I can think of ...
2
votes
1answer
48 views

adaptation of NIST sp800-22 for short sequences

I would like to ask about the NIST test suite for randomness evaluation. The test suite consists of 15 subtests which evaluate the particular property of the sequence. In fact, each test has an ...
2
votes
1answer
133 views

HMAC-SHA512 output randomness?

This is regarding an online roulette game that claims to be fair. Here is the explanation: Two strings are created: ...
1
vote
2answers
107 views

How is a ciphertext encrypted using random numbers decrypted using a symmetric key algorithm

We use true random number generators as a source of keys for encryption. What I can not wrap my head around is: How is this cipher text decrypted in case of symmetric key algorithm as we need the same ...
2
votes
0answers
32 views

ZK-proof of usage in a seed of CSPRNG

Assume a Player chooses a seed $s$ and he wants to prove that he uses it as a seed to CSPRNG function, where the seed is not public. How can he prove it? Thanks.
1
vote
0answers
32 views

Can you rely on the permutation of a ciphertext for secrecy?

Say you have a message and you run it through an all-or-nothing transform. A transform that requires every single block in the correct order in order to recover any data. Each block is ...
1
vote
1answer
98 views

repeatedly hashing result and using reverse sequence as RNG secure?

I want to have a source of randomness for which: no one but me can predict the next number in the sequence. I know the entire sequence in advance, but I have no way of manipulating it once the first ...
3
votes
1answer
95 views

Cryptanalysis on affine like matrix based strange cryptographic scheme [closed]

This is a garage made encryption scheme provided as cryptanalysis practice during 34C3 CTF. The challenge is done under the following assumptions All Mersenne twister instances are MT19937 64bit ...
2
votes
1answer
79 views

LFS Kolmogorov Randomness

Consider following LFS register (where + denotes addition modulo 2) I have found the output sequence as 1,0,1,1. I know that The K(s) of a string s is defined as the length of the shortest computer ...
4
votes
1answer
218 views

Identifying the type of algorithm for a PRNG that uses modular multiplication and addition

GNU libc uses the following pseudo-random number generator: $$(\mathit{state} \times 1,103,515,245) + 12,345 \pmod {2^{31}}$$ where state is the result of the previous call to the generator. My ...
0
votes
5answers
168 views

Pseudorandom number generator for which it is impossible to deduce the seed

I'm looking for an RNG that in the case that an attacker would get all or part (most likely part) of the pseudorandom data, there will be no way for them to deduce the original seed more efficiently ...
3
votes
2answers
150 views

Is this a good way extracting randomness from some physical process?

Let's say the system has a hardware randomness generator, generating random numbers using a proven truly random process. The distribution of the numbers though, is unknown. Assume the randomness ...
8
votes
1answer
995 views

Why does BCRYPT_RNG_DUAL_EC_ALGORITHM get removed from CNG API on Windows 10?

On article at => Microsoft Docs CNG Algorithm Identifiers I notice that BCRYPT_RNG_DUAL_EC_ALGORITHM is now removed since Windows 10. Beginning with Windows ...
1
vote
0answers
41 views

Geometry of the outputs of linear congruential random number generators

I learned that possible $m$ long sequences produced by linear congruential random number generators(of the form $r_{i+1}\equiv ar_i+b \mod n$) fall on hyperplanes. Using this fact I have come to think ...
1
vote
0answers
74 views

What is the fastest way to generate truly random one time pad without electrical or any other complicated device?

I want to generate truly random one time pad as fast as possible but without the use of any electrical or any other complicated device. What is the fastest way to do that?
3
votes
3answers
153 views

Usage and limitations of sponge functions for PRNG

This HRNG uses SHA3 as a sponge function (in its device driver) to inflate ots raw source output to many MByte/s. They compare this output rate to the output of other HRNG which don't use a sponge ...
1
vote
0answers
65 views

How Are Linear Congruential Generator Multipliers Chosen?

There are several numbers that keep coming up when looking at certain random number generators, for example 6364136223846793005 is used in newer pcg-family algorithms and seems to draw it from ...
1
vote
0answers
31 views

Question on inputs of PRFs and HKDF KDF

I've read a lot of information about PRNGs, PRFs and KDFs. As far as I know: PRNG: The seed for the PRNG must be a uniform string. It transforms a short real uniform string into some bits of pseudo-...
7
votes
3answers
361 views

Perform ENT / Dieharder on raw entropy or on whitenened entropy?

In this question about hardware random number generator, a discussion about the following question has been started: In order to test RNG's and entropy's quality, should test suites like ENT and ...
17
votes
5answers
3k views

Why are PRNG in programming languages not cryptographically secure by default?

In most programming languages, there is a module or function in the stdlib for creating random output like random.random() in Python. Because those functions use a ...
0
votes
1answer
210 views

Any concrete examples of the use of NIST Special Publication 800-90B?

This question relates to NIST Special Publication 800-90B, Recommendation for the Entropy Sources used for Random Bit Generation. A copy is available here. Can anyone supply a pointer to any ...
7
votes
3answers
358 views

Differences between methods of hardware random number generators

I'm reading about various hardware random number generators which - among others - implement the following approaches: Analog-to-digital converter noise Johnson–Nyquist noise Reverse biased ...
3
votes
2answers
90 views

Figure out algorithm to numeric key generator with one known input and output

I have a software program running on a piece of hardware. To access a specific functionality it runs a challenge-response-like authentication, that is it generates a numerical 4-digit PIN and expects ...
5
votes
2answers
99 views

Is a tree of CSPRNGs secure?

Given two CSPRNGs $A$ and $B$ (of possibly the same family/algorithm), where $A$ is properly seeded from a high-entropy source, can $A$ be used to seed $B$ without compromising the security of either? ...
6
votes
1answer
135 views

In coin flipping protocols, why aborting is allowed, and why the non-aborting party flips a coin at the end?

To convey how an adversary can bias the coin, most often a simple commitment-based two party coin-tossing protocol is given, as in [1]: Alice sends Bob the commitment $c = commit(x)$ Bob sends Alice ...
1
vote
1answer
250 views

ECDSA vulnerability related to recovering private key using same r

I'm considering this for bitcoin transaction as it uses ECDSA so if the signer generates two signatures suppose s1 and s2. where: I get it that any attacker who have s1 and s2 can recover its private ...
5
votes
3answers
1k views

Encrypting RNG output

Under the following premise: I need to generate multiple symmetric keys; I cannot be sure about the quality of local system RNG; I already have a strong key K (generated by other means / elsewhere). ...
0
votes
2answers
51 views

Technical term for hash value being uncorrelated to input message?

Is there a technical term for the desirable property of hash functions. That a small change to the input message will produce a massive unpredictable and seemingly uncorrelated change to the output ...
0
votes
0answers
44 views

Proof that previous numbers in a series must have existed before next number

A system provides users with a number when they query it for one. The system may provide numbers that increment by 1, 2, x or an entirely different pattern. For example, the system may start at 0 ...
1
vote
1answer
72 views

Looking for CPRNG implementatoin [closed]

I'm looking for commonly used and proven CPRNG implementation in C. What to use? ChaCha20 like in Linux Kernel? Does anybody know other implementations? PS: I don't want to implement by itself ...
1
vote
1answer
132 views

Example of calculating a primitive root for large prime?

I am trying to figure out how to calculate primitive root $w$ for a prime. Following what I read, I generated my prime to be 'safe prime', $p=qr+1$. I know $q$ (also prime) and $r$. Let's assume, ...
0
votes
1answer
82 views

Is there a feasible way to generate an RSA key manually the same way as it is for an ECC one?

In elliptic curves, a private key is just a random number, and one relatively small compared to other crypto systems (256 bits for ECC vs 4096 bits for RSA for example). Suppose I don't trust ...