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

-2
votes
1answer
34 views

Given a point $c$ in a field $Z_p$. Can we get another value $c^{'}$ such that $\left(c^{\prime}-c\right)$ is invertible in $Z_p$?

If we have a point in a field $c$. Can we get another value $c^{'}$ such that $\left(c^{\prime}-c\right)$ is invertible in $Z_p$ ?
2
votes
1answer
162 views

Asymmetric CSPRNG where the public key only works backward

Is there an asymmetric cryptographically secure pseudo random number generator in which the public key only goes backward? For example, I'd like to generate 5,000 digits, then provide the public key ...
14
votes
3answers
3k views

Can we assume that a hash function with high collision resistance also means a highly uniform distribution?

I want to use a hash function to generate a random sequence from number 0-n. And so I would like to find a good function that results in values that are seemingly random (does not need to be secure), ...
3
votes
2answers
86 views

Does a regularly reseeded PRNG provide backtracking resistance?

I'm currently discussing a security topic with some of my classmates. A cryptographic PRNG typically provides backtracking resistance if an adversary that compromises the internal PRNG state cannot ...
2
votes
1answer
65 views

Mapping between NIST test and TRNG features

Each of the NIST tests are generally explained in Random Bit Generation - Guide to the Statistical Tests. I was wondering if some one can help me understand them better. For example, which tests show ...
1
vote
1answer
115 views

Understanding $\varepsilon$-advantage in cryptographically secure deterministic RNG

In Efficient and Secure Pseudo-Random Number Generation by Vazirani & Vazirani, it is stated that every pseudorandom number generator which satisfies the XOR Condition can securely output $\log n$ ...
1
vote
1answer
62 views

Stream cipher — Are all random bit generators suitable for stream cipher?

I learned the stream cipher using LFSR in the book. I wonder whether all random bit generators (i.e. BBS, Rabin generator) are suitable for stream cipher. I search using keywords "stream cipher" and "...
2
votes
0answers
37 views

Is it possible to use a XOF function as csrng? [duplicate]

Let's say we "seed" a xof function (eg. SHAKE256) with x cryptographically random bytes (enough so that they can't be bruteforced), could said function be used as a cryptographically secure random ...
1
vote
1answer
63 views

Why is LCG PRNG chosen to be as c++ rand() function?

The C++ rand() function is an Linear Congruential Generator (LCG) PRNG. my questions are: Why was this algorithm chosen? What are the pros and cons? Is it good for cryptography?
4
votes
1answer
121 views

Using a non-secure random generator for IV or salt generation

I was just looking at a post on Code Review when I noticed the other answer to the post. While I would agree mostly with the answer, I do however doubt if having a Cryptographically Secure PRNG is ...
4
votes
3answers
199 views

Can a deck of cards be used as a practical source of cryptographic randomness?

This is not a duplicate of Entropy measurement from shuffled cards, as this concerns use of cards as a cryptographic entropy source, rather than calculating entropy from some number of cards. The ...
5
votes
1answer
622 views

Is openssl rand command cryptographically secure?

I'm wondering if the openssl rand command produces cryptographically secure random bytes. For example when in need for a random password or token: ...
3
votes
2answers
87 views

How to make a hypothesis test for a simple statistical test for a certain RNG?

I'm self-studying about hypothesis test in the context of RNGs. I'm building a hypothesis test from scratch. I'm taking the simplest statistical test I can think of: how many $1$s are there in the ...
2
votes
3answers
145 views

Are XOFs and KDFs more usable than DRBGs?

CSPRNGs have 2 design requirements: output unpredictability, back-tracing resistance. In addition to which, NIST SP 800-90Ar1 added other features such as a) instance customization/personalization,...
2
votes
2answers
153 views

Why should one model an entropy source in order to build a TRNG?

Some assert that a theoretical model of the unconditioned source must be created when building any TRNG. It's believed to be a fundamental requirement. So a few related questions arise:- What is a "...
-1
votes
1answer
60 views

Brute forcing/hacking Secure passphrases - difficulty for random strings vs real words

I was wondering about this topic of brute forcing passwords,or ANY other way to deriving them - and asking myself whats more secure (relatively): A Password which includes A) 30 digits length- a ...
0
votes
2answers
65 views

secret and unique random number generator within a range

I am trying to think of a way to generate secret and unique random numbers within a range. Say we have a public range [1-n], how could we have a maximum of n users choose a random number within this ...
2
votes
1answer
140 views

What are implementations of PRNGs based on ChaCha20? [closed]

I thought I'd find an implementation in NaCl, but /dev/urandom is what I find. Search engines samples revealed most implementations are broken. What libraries are ...
2
votes
3answers
167 views

Low entropy - how does it compromise the crypto

One of the often pointed out mistake in dealing with crypto is not having enough entropy in the system. Without enough entropy the random numbers generated are not random enough. But what I am not ...
2
votes
1answer
81 views

How was the 5 digit random number in the VIC cipher generated?

Knowing that VIC was a "spy cipher" it is unlikely that the agents used a cryptographic device to genreate the 5 digit number but how did they do it?
5
votes
3answers
473 views

Hardware RNG Bias

I have generator based on sampled noise (reverse-biased transistor - actually ChaosKey but that's not that important). The noise source is fed into ADC and sampled with 16bit resolution (2 bytes). ...
-2
votes
1answer
55 views

Method for generating random number(s) [closed]

I was reading about random numbers and their usage in security. I'd like to verify with more experienced people how good this method of generating random numbers will be. Human beings are very hard ...
6
votes
1answer
134 views

Distinguishing generators of RSA primes and moduli

We are trying to distinguish two RSA prime generators: Prime generator 1 draw uniformly at random an integer $p$ with $2^{1023.5}<p<2^{1024}$, until it is prime output $p$. Prime generator 2 ...
3
votes
2answers
2k views

Example of cryptography random number

I read that random numbers are being used in cryptography and security. I think I have idea how to truly generate true random, non-deterministic number. But before continuing further I'd like to ask ...
2
votes
0answers
44 views

Generating sets of unreadable/secure and unique random numbers

In the process of some research I have been doing I stumbled across the following 2 claims on the PokerStars website. We do record all of the hole cards in all real money hands. This is an ...
2
votes
1answer
110 views

In the Linux Kernel 4.8+, does the CSPRNG update the entropy pool?

My understanding of how /dev/urandom works is that the kernel collects true randomness from a variety of sources, and mixes them together to remove statistical bias. It does this at regular intervals ...
4
votes
1answer
352 views

Salsa20 as a PRNG with streams

Can I use Salsa20 as a good non-cryptographic PRNG with different streams if I reduce the number of rounds to 8 and omit the addition step at the end? I want to omit the final step because I don't ...
0
votes
0answers
132 views

Set passes Dieharder randomness with ints values, fails when ints are split into bytes

I've generated 100M of random numbers in range (0..255). These numbers fail Dieharder tasts (bitnum = 8). However, I can pass this test by combining four bytes into an int. Randomness of the set didn'...
1
vote
1answer
82 views

Can POS devices really generate random numbers?

I am doing an implementation of a system designed by a payment company and I am a little skeptical about the way they have designed the end to end cryptography. The system is as follows: There are ...
8
votes
5answers
857 views

Entropy vs predictability in PRNGs

If entropy is the measure of surprise, and a given PRNG has a uniform distribution, then the entropy would be high. So the Mersenne Twister(MT) has high entropy. But the MT is also predictable. You ...
0
votes
0answers
82 views

How to get unknown constants from linear congruential generator

I need to crack this linear congruential generator. I have $$X_{n+1}=a⋅X_n +b \pmod m$$ I know: $m=31,X_3=30,X_4=19,X_5=26$ How can I find $a,b$ and $X_0$? I have got already the following ...
0
votes
2answers
165 views

Aes Ctr non-secure PRNG

I want to construct a seeder for a big state PRNG (xorshift1024 based) and have been thinking about using Aes Ctr using multiple 256 bit keys, where the counter is simply encrypted multiple times (...
3
votes
2answers
196 views

Implementing randomness extractors

A randomness extractor is a function that takes an input sampled from high entropy distribution and outputs a value that is close to uniform distribution. It is slightly different from a PRG. PRGs ...
5
votes
1answer
239 views

Exactly what RNG weaknesses endanger (EC)DSA?

RFC 6979 defines deterministic variants of (EC)DSA. It states in introduction One characteristic of DSA and ECDSA is that they need to produce, for each signature generation, a fresh random ...
1
vote
2answers
372 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 ...
4
votes
3answers
3k 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
48 views

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

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
2answers
271 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 ...
1
vote
2answers
100 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
135 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. ...
0
votes
1answer
107 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
2k 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
134 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
803 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
87 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
135 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
174 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
474 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
60 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 ...