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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

A random number generator is a software or hardware solution which functions as a generator of (real or pseudo) random numbers (or bits).

4
votes
1answer
132 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
142 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
0answers
40 views

How does the function add_disk_randomness work? [migrated]

I am trying to understand the add_disk_randomness function from the linux kernel. I read a few papers, but they don't describe it very well. This code is from ...
3
votes
2answers
108 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 ...
7
votes
1answer
959 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
39 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
61 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
127 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
35 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
27 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
259 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
2k 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
88 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
240 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
83 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
81 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
126 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 ...
0
votes
1answer
121 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
50 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
40 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
58 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
49 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
69 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 ...
3
votes
1answer
107 views

What is the relationship between entropy conditioning and final output bias in a TRNG?

This question concerns the conditioning and output of true random number generators. It refers to NIST Special Publication 800-90C, Recommendation for Random Bit Generator (RBG) Constructions. It ...
7
votes
3answers
326 views

How to evaluate chi squared result?

I've been recently working on a (supposedly) TRNG. I'm still at the beginning of the project, so it is certainly not cryptographically secure yet, for now I'm just playing around. In fact, I've ...
6
votes
2answers
208 views

Are my random numbers really “bad” or is that a statistical effect which “must” happen from time to time?

My software uses a TRNG (entropy source) which is part of an MCU. A check of random numbers generated by my software, carried out by a testing authority revealed a problem, which I have to examine ...
1
vote
0answers
90 views

Decrypt an tex file encrypted with rand() [closed]

Link to encrypted tex file: https://drive.google.com/open?id=1gZCujDYmEL-FZ5o_xBUS-Ng5979HSsZ7 This is my attempt at solving the problem: ...
7
votes
2answers
321 views

Random number generator issue

I wrote a litte random generator using a geiger tube. I use a 16bit timer that overflows every ~1ms; when i get a reading form the geiger (~36count/minute), i save the current timer value as "random ...
6
votes
1answer
223 views

Can reduced-round ChaCha be used as non-cryptographic fast PRNG to produce output indistinguishable from random data?

The fastest known attack against the Salsa20 family of stream ciphers requires 2137 simple operations against Salsa20/7, or 2244 against Salsa20/8. The 8-round version encrypts data at 1.88 cycles-per-...
1
vote
3answers
265 views

How to deterministically generate a 256 bit ECC key from 128 bits of entropy without a CSPRNG

A safe way to generate a 256 bit ECC key from 128 bits of entropy is to use a CSPRNG, according to this answer: https://crypto.stackexchange.com/a/56551/43864 However, it's difficult to find a cross ...
1
vote
2answers
77 views

Purpose of folding a digest in half

The Linux kernel's random driver generates randomness by hashing an entropy pool using SHA-1. From the driver's source, the SHA-1 hash is apparently folded in half before being returned: ...
3
votes
1answer
72 views

Seeding the Fortuna PRNG for the first time

I am trying to understand how the Fortuna PRNG should be seeded correctly for the first time. Let's assume that we do have a large-enough seed file available, but not any entropy sources during first ...
2
votes
1answer
256 views

384-bit ChaCha20 / Salsa20

The standard Salsa20 core is a $\{0,1\}^{384} \to \{0,1\}^{512}$ PRF with a 16 byte constant ($\sigma$ for a 32-byte key), an 8 byte nonce, an 8 byte counter, and a 32 byte key. The hash function does ...
0
votes
1answer
72 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 ...
2
votes
0answers
41 views

Combining multiple hash functions for HKDF

I'm trying to apply the hash function combination method described in https://eprint.iacr.org/2013/210.pdf to a HKDF PRNG construction. Thing is it needs 4 uniformly random parameters/keys chosen by ...
-1
votes
1answer
87 views

Random number generator in a 2p2 Network

for my thesis I am trying to develop a system where nodes from a peer to peer network agree in generate a random number every tot seconds. I am stocked in this problem since almost 1 week anyone can ...
2
votes
0answers
121 views

Can Verifiable Random Functions be used to pick a random node from a pool?

Let's say that I have a decentralized system and I have a list of nodes published on a pubic log like a blockchain. I want a node A to be able to connect to another ...
1
vote
2answers
57 views

CSPRNG generation vs asymmetric encryption performance

It might sound like a weird comparison, but which one is faster, If I were to generate a CSPRNG every time or to sign(private encrypt) a data?
1
vote
3answers
95 views

Is there a CSPRNG capable of generating a large sequence of numbers from a single seed?

In my CS course i am in dire need of a CSPRNG that can create N numbers starting from a single key. Something like this: CSPRNG(x): Input 64 bit int; Output Array of CSR 64 bit Ints; ...
1
vote
2answers
122 views

How to calculate the bias of cryptographic hash output from biased input?

Assume that I have a hardware entropy source. Not a TRNG, but the source that might feed a TRNG's extraction algorithm. This source produces independent bits with a not unreasonable bias of $60/40$. ...
4
votes
3answers
244 views

What is proper use of a True Random Number Generator?

Let's say I have a true random number generator TRNG. Random numbers are generated on demand from a HW-entropy source, resulting in a 32-bit random value each time it is called. I have to fill an ...
0
votes
2answers
188 views

Algorithm to generate ECDSA keys with random number generator

I have a certified random number generator (TRNG, it does not matter what it is for the question). I would like to use it as a source to generate secp384r1 ECDSA keys. What is the algorithm I should ...
1
vote
3answers
104 views

What’s the difference between a secret key and a seed?

I always hear that if you have the seed then you can easily obtain the key. So, is the secret key just typically an expanded version of the seed? If so, via some key derivation algorithm? Also, if ...
1
vote
1answer
131 views

Can two different seeds produce the same output from a PRNG?

In general, is it possible that two different seeds produce the same output from a PRNG? I'm not sure how many different types of PRNGs there are and maybe it depends on which one we consider. I know ...
1
vote
1answer
88 views

What are the required properties of a PRNG to make it suitable for a stream cipher?

As an example, if a PRNG passes the BigCrush test suite, and has a period of 2^1024, can it be used on its own to make a secure stream cipher? What are the required properties, and similarly, what ...
2
votes
1answer
107 views

How can we add real values using GF field?

In GF($2^4$) usinfg primitive polynomial g(x) = $x^4 + x^3 +1$, 2+3 = 1 since 010 + 011 = 001, 2 + 2 = 0 Is there any encoding to get 2 + 3 = 5 and 2 + 2 = 4 in GF.
0
votes
0answers
60 views

OTP PRNG re-use

I'm setting up some external hardware for OTP encryption to take care of all the issues that can arise with key storage, re-use etc. I'm using the ISAAC secure PRNG to get my stream of numbers which ...
-2
votes
1answer
275 views

Is it possible to attack an SHA-256 hash seeded with PHP’s mt_rand function?

Is it possible to attack this construction if the attacker only knows the hash? ...
-3
votes
1answer
267 views

simple encrypt/decrypt [closed]

I would like to encrypt a file by XORing the source message with a prng of my own. The prng is streaming a flow of sha512 hashes. Each hash is produced from the previous hash plus constant string plus ...