Skip to main content

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
86 votes
11 answers
11k views

Is modern encryption needlessly complicated?

RSA, DES, AES, etc., all use (relatively) complicated mathematics to encrypt some message with some key. For each of these methods, there have been several documented vulnerabilities found over the ...
Ozzah's user avatar
  • 977
52 votes
6 answers
18k views

Who uses Dual_EC_DRBG?

Recent news articles have suggested that the NSA may be involved in trying to influence the cryptography in public standards or commercially deployed software, to enable the NSA to decrypt the ...
D.W.'s user avatar
  • 36.5k
42 votes
6 answers
21k views

What does it mean for a random number generator to be cryptographically secure?

I've never heard a good answer. I'd like to hear details about: What are the criteria that make an RNG cryptographically secure? Why must your RNG be cryptographically secure? I.e., what are the ...
agotsis's user avatar
  • 547
40 votes
5 answers
31k views

What is the difference between CSPRNG and PRNG?

What is the difference between CSPRNG and PRNG? Is there performance differential between them? For example: We use PRNG for key generation which is very expensive and CSPRNG for IV/nonce in block ...
randomness's user avatar
39 votes
1 answer
31k views

Explaining weakness of Dual EC DRBG to wider audience?

I have an audience of senior (non-technical) executives and senior technical people who are taking the backdoor in Dual_EC_DRBG and considering it as a weakness of Elliptic curves in general. I can ...
DeepSpace101's user avatar
  • 1,717
36 votes
5 answers
13k 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 that 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 ...
kelalaka's user avatar
  • 49k
35 votes
8 answers
13k views

Why do some people believe that humans are "bad at" generating random numbers/characters like this?

I'm not even sure if they are serious, but I've heard many times that some people refuse to not only trust their computer to generate a random string (which is understandable) but also don't trust ...
K. B.'s user avatar
  • 383
32 votes
6 answers
5k 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 ...
learnerX's user avatar
  • 687
31 votes
2 answers
6k views

Blum Blum Shub vs. AES-CTR or other CSPRNGs

Following on from D.W.'s comments on a previous question, what properties does Blum Blum Shub have that make it better / worse than other PRNGs? Are there significant implementation difficulties or ...
Polynomial's user avatar
  • 3,527
31 votes
2 answers
14k views

Is HMAC-DRBG or Hash-DRBG stronger?

Out of the two deterministic random bit generators defined in section 10.1 of NIST SP 800-90A (i.e. based on hash functions), which one is cryptographically stronger? Hash-DRBG (Section 10.1.1) HMAC-...
Lunar Mushrooms's user avatar
31 votes
4 answers
6k views

How to fairly select a random number for a game without trusting a third party?

Several people are playing a game with random events and require a way to produce a random number. (Such as dice rolls or a lottery.) Can this be done such that each player has the power to be ...
billpg's user avatar
  • 711
30 votes
8 answers
9k views

Can you use memory errors as a source of randomness for cryptography?

Obviously, if you need a random number for cryptography, your code should use an api that gets it from hardware. However, not all hardware has a SRNG available. If you are working on a security ...
TheCatWhisperer's user avatar
27 votes
5 answers
7k views

Could RDRAND (Intel) compromise entropy?

I was recently discussing the issue of RDRAND in Intel chips and the whole issue about how NSA could potentially be influencing Intel to weaken or create backdoors in their design. This petition was ...
Michael Aquilina's user avatar
26 votes
4 answers
7k views

How Brittle Are LCG-Cracking Techniques?

There are published techniques for cracking LCGs, but to my eye those techniques seem very brittle — very minor changes can add nonlinearity that renders techniques like the LLL algorithm unusable. ...
Charphacy's user avatar
  • 546
25 votes
4 answers
14k views

What tests can I do to ensure my random number generator is working correctly?

In the past I have used the Chi-squared test to check the statistical randomness of my generator. Is this a good test to use? Are there other tests?
this.josh's user avatar
  • 1,997
25 votes
1 answer
19k 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: ...
firefexx's user avatar
  • 407
23 votes
2 answers
16k views

Are the SHA family hash outputs practically random?

Say I hashed the output from a random number generator (with nonce), would the resulting SHA256 hash be as random as the inputted number? And If I used the first 5 hex characters, and then used the ...
John T's user avatar
  • 477
22 votes
6 answers
4k 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 ...
Aliquis's user avatar
  • 573
20 votes
2 answers
6k views

What stops the Multiply-With-Carry RNG from being a Cryptographically Secure PRNG?

Despite the fact that Marsaglia's MWC PRNG (multiply-with-carry random number generator) is considered to be "the mother of all RNGs", it does not seem to be considered to be a CSPRNG (...
e-sushi's user avatar
  • 17.9k
19 votes
2 answers
5k views

A website that identifies an RNG from its output

This happened during a discussion of RNG entropy, and the difficulty of verifying the level of entropy in a long sequence of bits (e.g. a private key.) A colleague of mine told me about a website ...
AJM's user avatar
  • 311
19 votes
2 answers
10k views

Is it safe to seed a random number generator from system time?

It seemed to me that the Bouncy Castle SecureRandom class for C#/.NET only uses DateTime.Now.Ticks as its seed by default. I ...
Edward Ned Harvey's user avatar
19 votes
3 answers
6k views

Webcam random number generator

I have a question about random number generators. I have read from a real random number generator, based on a webcam ("randcam"). My problem is, that I do not really understand how the generation of ...
Simon Rühle's user avatar
18 votes
1 answer
9k views

Where do Windows applications get entropy from?

Where does the entropy that cryptographic .NET libraries use for encryption come from? I know with Linux you can use /dev/random, but does a similar pool exist ...
Verbal Kint's user avatar
18 votes
1 answer
1k views

Why did NIST remove The Lempel-Ziv Compression test from the Statistical Test Suite?

NIST removed "The Lempel-Ziv Compression" test from the Statistical Test Suite in revision 2008 and above and has not incorporated it since – see revision 2010. Why was it removed? Does it no longer ...
ir01's user avatar
  • 4,022
17 votes
8 answers
10k views

Would it be secure to use random numbers from random.org in a cryptographic solution?

Random.org provides true random numbers through an unsecured web service. Since these numbers would be transmitted in plaintext could they still be considered useful as true random numbers while ...
Jim McKeeth's user avatar
17 votes
5 answers
4k views

Examples of frauds discovered because someone tried to mimic a random sequence [closed]

[Moderator note: this question now lives there] So, I'm preparing a talk about the well known fact that humans are bad at the task of generating uniformly random sequences of numbers when asked to do ...
Swike's user avatar
  • 278
17 votes
4 answers
5k 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), ...
Thaina's user avatar
  • 293
17 votes
4 answers
7k 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 ...
Alexandro Babonoyaba's user avatar
17 votes
5 answers
3k views

Creating a small number from a random octet string

I'm trying to figure out the best way to generate a cryptographically secure random number between 0 and 200 (inclusive) from a cryptographically secure random string of bytes (ie. read from /dev/...
neubert's user avatar
  • 2,939
17 votes
1 answer
11k views

What to watch for with openssl generating weak keys? (low entropy)

(Disclaimer: I am regular software engineer with only basic crypto knowledge, so helpful if can be explained for a layman.) I am concerned about generating weak keys on a shared linux box with ...
Brian Armstrong's user avatar
17 votes
1 answer
5k views

Can a LFSR be cryptographically secure?

I have been looking at an embedded microcontroller which has a cryptographic hardware engine (in particular the PIC32MZ family). These devices have what they advertise as a cryptographically secure ...
Duncan Drennan's user avatar
16 votes
4 answers
5k views

Is there a cryptographic algorithm that can make a "lottery ticket"?

With public-key cryptography, I know Alice can "seal" a message that only Bob can open. But in that case, Alice knows the message that she is sealing. What if Alice wants to seal a random ...
mherzl's user avatar
  • 263
16 votes
2 answers
16k views

Predicting values from a Linear Congruential Generator

I have learnt that Linear Congruential Random Number Generators are not cryptographically secure - my understanding is that given an LCG of the form: ...
Flash's user avatar
  • 263
16 votes
2 answers
4k views

Quality of randomness on a Linux system with haveged

Has anyone checked if using haveged, a Linux daemon which uses the HAVEGE algorithm, changes the non-deterministic properties of the random data from ...
Hal Bal's user avatar
  • 171
16 votes
1 answer
3k views

AMD's implementation of RDRAND instruction

The latest AMD programmer manuals, dated June 2015, include the RDRAND instruction in the instruction set. For completeness, it lacks ...
user avatar
15 votes
2 answers
4k 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 ...
Red Book 1's user avatar
  • 1,025
14 votes
5 answers
3k views

How to prove the security of the PRNG?

Are there any realties tests or criterias that prove the security of the PRNG? What kind of tests or criteria?
NiceTheo's user avatar
  • 591
14 votes
3 answers
3k views

Entropy of two concatenated random values

In this Intel blog posting, the author claims: The amount of work required to brute-force predict a random value that has n bits of entropy is $O(2^n)$. If you concatenate two values together, the ...
user13741's user avatar
  • 2,627
14 votes
4 answers
2k views

Properties of PRNG / Hashes?

There are a lot of quite elaborate PRNG's out there (e.g. Mersenne Twister et.al.), and they have some important properties, especially when it comes to crypto applications. So, I was wondering how ...
bitmask's user avatar
  • 283
14 votes
1 answer
4k views

Mixing Entropy Sources by XOR?

Assume that I have two sources of entropy (say, a hardware RNG and a CSPRNG) and that the two sources are independent (do not know anything about the internal state of the other RNG). Can I mix them ...
David's user avatar
  • 334
14 votes
1 answer
1k views

How random are commercial TRNGS

I'm thinking about buying a USB TRNG. How do I evaluate its randomness? I'm sure some are better than others but which is which? Are thermal-noise better than radio-noise TRNGs?
user1028028's user avatar
14 votes
1 answer
2k views

What issues are there while using Linux's /dev/urandom for generating cryptographic keys?

As of Linux 5.1 the /dev/random no longer uses the blocking pool. There is a talk about the change on the page Removing the Linux /dev/random blocking pool I ...
kelalaka's user avatar
  • 49k
14 votes
4 answers
5k views

Can machine learning analyze random number generator?

I'm studying for random number generators(RNG) and I saw about machine learning a few days ago. So I searched analysis of RNG using machine learning. But I couldn't find such fields. Are there such ...
Tylor Yoo's user avatar
  • 141
13 votes
7 answers
6k views

Can I encrypt a message by swapping bits in the text?

I have tried out an encryption method, in which I swap bits in the text. The text length is N bit, then I generate several random number pairs in the range 0..N-1, as [n,k] pairs. After that, I swap ...
Konstantin's user avatar
13 votes
2 answers
1k views

Can any block cipher in CTR mode be used as a CSPRNG?

I have been learning about block ciphers, modes of operations, and csprngs by myself for a few days and there are some things I'm unsure about. Assuming we only talk about cryptographically secure ...
Qøtēx's user avatar
  • 135
13 votes
2 answers
4k views

Uniformly distributed secure floating point numbers in [0,1)

Is there any way to generate cryptographically secure uniformly distributed floating point numbers in the interval [0,1)? For example, in Javascript, there is ...
serv-inc's user avatar
  • 241
13 votes
2 answers
2k views

Is CPU timing jitter a usable entropy source?

In some virtualized environments, the only source of entropy available is CPU timing jitter. Can one get enough entropy from this source for practical uses? Also, is this secure against local side-...
Demi's user avatar
  • 4,793
13 votes
1 answer
4k views

Cracking a PRNG by observing ranks within groups of its output

Suppose that I am generating random numbers with Python's random module, so that there is a known random number generator (Mersenne Twister in this case). I've ...
dcc310's user avatar
  • 273
12 votes
4 answers
11k views

How are random numbers for RSA generated? [duplicate]

The RSA public key encryption requires two very large prime numbers as part of its encryption process that serve as secrets. These are typically generated with cryptographically secure random number ...
Billy ONeal's user avatar
12 votes
2 answers
7k views

Does using modulo (%) affect quality of randomness?

I'm writing a small script that generates random non-signed decimal integers within a certain range of values. I'm using GNU od, with the following command: ...
user avatar

1
2 3 4 5
17