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

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

3
votes
1answer
165 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
55 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
75 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
44 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
41 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
39 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
54 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
36 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
81 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
71 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
31 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.
0
votes
0answers
77 views

privacy preserving distance calculation

I am working on privacy preserving distance calculation, I have implemented two techniques randomization and swapping. However, the resulted edit distance is not 100% preserved because of the ...
0
votes
0answers
48 views

Cracking Mersenne Twister -> HMAC

I'm working on a challenge that uses Python (not sure which version, which is an issue) that generates a random 256-bit key with getrandbits() and uses that with ...
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
87 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
87 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
57 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
173 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
161 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
132 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
980 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
72 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
137 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
51 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
304 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
136 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
288 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
85 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
92 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
132 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
194 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
42 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
68 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
76 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
74 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 ...
4
votes
2answers
123 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
564 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
217 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
135 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
356 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
240 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
307 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
90 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
105 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
303 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 ...