Questions tagged [randomness]
Usage of randomness (i.e. non-predictable data, usually in the form of bits or numbers) for cryptographic purposes.
542
questions
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 ...
63
votes
5
answers
30k
views
Technical feasibility of decrypting https by replacing the computer's PRNG
Intel has an on-chip RdRand function which supposedly bypasses the normally used entropy pool for /dev/urandom and directly injects output. Now rumors are going on that Intel works together with the ...
43
votes
2
answers
32k
views
What is entropy?
We discuss a lot of topics and use measures of entropy to determine how difficult it is for an attacker to be successful. What does entropy mean in the context of cryptography? How is entropy ...
39
votes
5
answers
30k
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 ...
39
votes
6
answers
20k
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 ...
35
votes
8
answers
12k
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 ...
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 ...
25
votes
5
answers
5k
views
How useful is NIST's Randomness Beacon for cryptographic use?
NIST have just launched a new service called the NSANIST Randomness Beacon. It has been met with some initial skepticism. Perhaps the cryptography community would have used it before June 2013 when ...
24
votes
4
answers
1k
views
Necessity of Randomness of Salts?
Given the desire to have unique salts for each user of your system, is it actually necessary to create a cryptographically-random salt for each user?
If your system already has some other unique user ...
23
votes
2
answers
15k
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 ...
19
votes
5
answers
3k
views
How many hex digits do I need to compare when manually checking hash functions?
I sometimes run sha256sum on large files after transferring them from one place to another, and will just skim the hash output to verify it's correct. But, I usually just look at the first/last 5 or 6 ...
18
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 ...
18
votes
4
answers
4k
views
Using Tweets as a Random seed
I would like to start by saying I know nothing about Cryptography and was reading up on how to choose a random seed and this link is something that I found. What I basically understood that the seed ...
17
votes
12
answers
18k
views
Are one-time pads crackable in theory?
I've been taught that one-time pads are the only perfect encryption since the only way to recover the message is by knowing the key.
For example, for a target bitstring of 100 bits, I cannot scan all ...
17
votes
4
answers
14k
views
How can C rand() be exploited if a secure seed is used?
I've just started doing a research project on CSPRNGs and I would like to know what kind of vulnerabilities a regular PRNG has with a secure seed. For example, if I generate a random number using ...
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 ...
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 ...
16
votes
6
answers
3k
views
How exactly is "true randomness" defined in the realms of cryptography?
Especially in relation to stream ciphers, I frequently read about (sometimes theoretical, sometimes practical) attacks that are able to "distinguish a ciphertext from a truly random stream".
What's ...
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 ...
15
votes
2
answers
3k
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 ...
15
votes
3
answers
5k
views
What is the use of REAL random number generators in cryptography?
I understand the use of pseudo-random number generators. I am not getting mixed up between these and "real" random number generators.
However, I don't understand for what a real random number ...
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?
13
votes
1
answer
3k
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 ...
12
votes
1
answer
1k
views
On Linux, does /dev/random unblocking imply that /dev/urandom is seeded?
Linux has the familiar problem that /dev/random blocks too much (insisting on being information-theoretically secure), while /dev/urandom doesn't block enough (it will return data before it's been ...
11
votes
5
answers
3k
views
How to best obtain bit sequences from throwing normal dice?
Throwing normal dice, one can get sequences of digits in [0,5]. In practice, which is the best procedure to transform such sequences into a desired number of bit ...
11
votes
5
answers
4k
views
Radioactive Decay, Gaussian or Uniform?
I'm trying to understand the nature of true randomness. I'm building an RNG using a radioactive source. Basically, I'm measuring the time between consecutive decays which in theory should be ...
11
votes
3
answers
5k
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 ...
11
votes
1
answer
5k
views
XOR a set of random numbers
Basic question about XOR and entropy - given a set $S$ of pseudo-random numbers in the range $[0,b]$, will XORing them produce a new pseudo-random number in $[0,b]$ or will the operation decrease the ...
11
votes
5
answers
8k
views
How does generating random numbers "remove entropy from your system"?
In a previous question, I quoted the --gen-random entry in the GPG Man Pages. At the end it says:
PLEASE, don’t use this command unless you know what you are ...
11
votes
1
answer
2k
views
How random is the shared secret in the Diffie Hellman key agreement
How random is the value $ZZ$ in the DH protocol?
This question was triggered by this somewhat naïve implementation in I2P shown by Sergei at Stackoverflow. Obviously $ZZ$ is distinguishable from a ...
11
votes
2
answers
3k
views
Why use randomness in digital signature algorithms?
I understand why randomness has to be employed in encryption, because deterministic ciphers are not IND-CPA. I don't understand why digital signature schemes that employ randomness, like RSA-PSS, are ...
11
votes
1
answer
11k
views
ElGamal Signature Scheme: Recovering the key when reusing randomness
Show how if Alice uses the same value of $k$ to sign two different messages $m_1$ and $m_2$, using the ElGamal signature scheme, Eve can recover the value of $a$ from the corresponding signatures $(...
10
votes
3
answers
7k
views
How to generate a list of unique random strings?
How would you generate a list of distinct random strings, where all strings are alphanumeric and have a fixed length?
10
votes
3
answers
4k
views
Is a die implemented in a physics engine truly random?
So, a fair die throw is really random, not pseudo. So, would a RNG implemented as the result of a die throw in a physics engine (say, Newton, Havok, Nvidia's PhysX) be regarded as both ...
10
votes
2
answers
1k
views
Does an encrypted random sequence conserve its "randomness"?
If you have a random uniform sequence of bits $A$ generated by a TRNG with good performance of randomness tests (eg Dieharder, NIST, Kolmogorov complexity, chi-square, etc) and perform an encryption (...
10
votes
2
answers
5k
views
Why are HOTP and TOTP implementations all using 6 digits and not more?
I was checking the RFC's after wondering for some time. In RFC 4226 - HOTP: An HMAC-Based One-Time Password Algorithm, it states on the appendix:
A simple enhancement in terms of security would be to ...
10
votes
3
answers
1k
views
Perfect shuffle possible with limited raw entropy?
I am trying to shuffle a standard 52-card deck in a perfect way (every outcome should be possible at an equal chance). I am not, at this point, concerned with cryptanalysis attacks against it.
I have ...
10
votes
2
answers
382
views
Are poly1305 authenticators distinguishable from random data?
Assume Alice authenticates a message $M$ with nonce $N$ and secret key $K$, creating authenticator $A$. She then sends $A$ across the network.
The Poly1305 paper does not seem to specify whether it ...
10
votes
1
answer
2k
views
Why are MACs in general deterministic, whereas digital signature constructions are randomized?
The fact is I'm not quite sure if my question statement is true, however all the MAC constructions I know of (e.g. CBC-MAC, CMAC, HMAC) are deterministic, whereas many constructions for digital ...
10
votes
1
answer
8k
views
How are IVs used in association with RSA Encryption?
How are IVs used in association with RSA Encryption?
Can someone explain why we use them in this RSA context?
9
votes
3
answers
1k
views
Is there some way to generate a non-predictable random number in a decentralised network?
Is there a way to generate a random number with given restrictions:
It will be used in a decentralised network with a big number of peers (no central authority to generate it)
Its generation should ...
9
votes
3
answers
796
views
Universally verifiable random beacon
I am developing a network where potentially many many nodes (billions, in principle?) should be able to agree on a random number. I would really prefer to avoid $O(N^2)$ procedures where everyone ...
8
votes
11
answers
5k
views
Algorithm: How to use x and y mouse movement co-ordinates to generate random data?
Background:
I'm making a program for fun as a learning exercise. I want to generate some actual random key material (not pseudorandom) from a JavaScript program. For my program is just for encrypting/...
8
votes
4
answers
252
views
Why are $\lceil 1/\operatorname{entropy-per-bit} \rceil$ number of bits not sufficient to generate an unbiased bit?
Consider a biased RNG badrand() generating 1 with probability $0.9$ and 0 with probability $...
8
votes
3
answers
668
views
Why do we require a CSPRNG's output to be indistinguishable from true random?
Everywhere I read, indistinguishability of output from true random is stated as a requirement for CSPRNGs. However nobody bothered to give the rationale for such a strong requirement.
Specifically, ...
8
votes
3
answers
2k
views
Why does TLS 1.3 use random-looking nonces for AEAD?
In TLS 1.3, it seems that nonces for AEAD are constructed by XORing the recorded sequence number with the server/client_write_IV (which is generated during the handshake). Thus, nonces are random-...
8
votes
1
answer
1k
views
Discrete Gaussian Sampling role in Lattice-Based Crypto?
I'm reading up on how post-quantum cryptography works, and stumbled upon the notion of discrete Gaussian sampling. However, I can't understand where it fits in the greater picture - currently it feels ...
8
votes
1
answer
612
views
How to enhance randomness of AES?
I'm using PHP to encrypt a string and Java to decrypt it on a remote server. To perform the encryption, I'm using the strategy that can be found here.
My problem is that the strings I encrypt are ...
8
votes
2
answers
1k
views
How do you test randomness?
Suppose I receive a list of 1 million coinflips, and I want to know how likely it is that the list was randomly generated.
My first thought would be to count the number of heads and tails, which ...
8
votes
1
answer
396
views
Better lower bound on min-entropy
In “Randomness Condensers for Efficiently Samplable,
Seed-Dependent Sources” by Dodis, Ristenpart, and Vadhan (PDF), I have seen the statement that:
any tuple of distributions $(X,Z)$ is $\...