Questions tagged [randomness]

Usage of randomness (i.e. non-predictable data, usually in the form of bits or numbers) for cryptographic purposes.

Filter by
Sorted by
Tagged with
32
votes
5answers
23k 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 ...
11
votes
1answer
1k 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 ...
84
votes
11answers
10k 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 ...
37
votes
2answers
26k 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 ...
11
votes
3answers
3k 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 ...
15
votes
3answers
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 ...
6
votes
2answers
649 views

Can we exchange the permutation of a sponge construction?

Part of a sponge construction (like SHA3 uses) is a fixed permutation $p$; which is clearly not one-way. Could we, theoretically, exchange the permutation $p$ with any other permutation? What basic ...
9
votes
2answers
2k 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 ...
16
votes
6answers
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 ...
13
votes
1answer
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?
3
votes
3answers
1k views

Why in one time pad must the key distribution to be truly random

One time pad required a truly random key. Why canwt it be a psudo-random key? For example, if the key distribution is that for each bit the probability to get 1 is 0.6 and the probability to get 0 is ...
30
votes
6answers
11k 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 ...
6
votes
1answer
481 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 ...
7
votes
2answers
518 views

Does a practical collision attack on a cryptographic hash function also mean it fails “indistinguishable from random data”?

It is knowns that SHA-1 has been broken in practice using collision attacks. Related to SHA-1 this mainly had a negative impact on the security of Digital Certificate signatures Email PGP/GPG ...
11
votes
1answer
8k 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 $(...
1
vote
2answers
195 views

Leak Information?

Let a,b,c,d be selected at random from $\mathbb Z^*_q$. We pick values $r_1,r_2,r_3,z_1,z_2,z_3 \gets \mathbb Z^*_q$. Do $u_1,u_2$ that are computed as follows, leak information about values $a,b,c,d$...
2
votes
2answers
653 views

NIST randomness test p values

I have a binary sequence of length $2^{20}$. I am using the NIST statistical test, assess. What should be taken for ./assess and ...
23
votes
4answers
850 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 ...
21
votes
5answers
4k 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 ...
7
votes
4answers
2k views

When is an RNG a CSPRNG, a CSRNG, or a TRNG?

In a recent answer to a question about CSPRNGs, it was stated that… Nondeterministic algorithms where there is no such requirement, and ideally could be replaced by a true random generator. Example: ...
11
votes
5answers
2k 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 ...
4
votes
8answers
3k views

How to convert a set of sequential integers into a set of unique random numbers?

I have a set of sequential and non-duplicate integers which I would like to convert into a set of non-duplicate random integers. What I want to achieve is this - I have a list of sequential numbers ...
17
votes
2answers
10k 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 ...
12
votes
1answer
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
5answers
6k 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 ...
5
votes
1answer
459 views

Strategy for random CTR initial counter values

Alice has a secret key which she uses to encrypt messages in CTR mode. CTR mode is critically vulnerable to counter reuse, and Alice has a problem: she has terrible memory and no pen to write anything ...
4
votes
3answers
1k views

Statistical properties of hash functions when calculating modulo

When using SHA-1 to hash an input, the result is a pseudo-random number in the numeric ID space $\{0\dots2^{160}-1\}$. Do I loose any statistical property in the result if I use modulo to restrict the ...
4
votes
2answers
2k views

Whitening and randomness extraction

The Von Neumann randomness extractor is explicitly mentioned in the randomness extractor page of Wikipedia, but strangely enough that page does not contain any reference to whitening the results of an ...
2
votes
4answers
389 views

Randomness Testing

Let say I have three sequences: S1 = {1,2,3,4,5,6,7,8,9,10} S2 = {3,7,1,9,4,10,5,8,6,2} S3 = {8,3,10,2,6,7,1,5,9,4} i.e. S2 and S3 are just the permutations of S1. Is there any method to check how ...
8
votes
3answers
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 ...
6
votes
2answers
1k views

How can I extract randomness from a JPEG file?

In a previous question I asked if (and why) BlueRand can or cannot be considered as a TRNG. Established that it's not a TRNG (due to the reasons explained by some users in the previous question), ...
6
votes
2answers
704 views

Using chi square for distinguishing between compressed and random data

I am trying to find some measurement for identifying and distinguishing between compressed and random data. I tried this first by computing the entropy of such data, the entropy value is extremely ...
5
votes
1answer
271 views

Understanding hash entropy

I have been told that one advantage of using a hash function is that it spreads entropy over all input bits. But it also seems to be true that a bad hash algorithm can make things less random. But how ...
5
votes
2answers
1k views

Why does a Hashing Function produce good Random Numbers if Input is random?

I've heard about using a hash approach to create random numbers based on two independent entropy sources A, B: $h_{i} = H(a_i+b_i)$ $H$ could be for instance SHA-1, or SHA-256. My questions are: 1)...
4
votes
1answer
177 views

Synthetic Jitter to Combat Timing Attacks

We are working on some tooling. It has a networking kernel. We would like to think that jitter built into the kernel would help with timing attacks? Is this true?
4
votes
1answer
2k views

Fastest random number generator

I just read High performance physical random number generator by K.H. Tsoi, K.H. Leung and P.H.W. Leong. It proposes a physical RNG of speed 400 Mbps. Is this the fastest random number generator at ...
3
votes
2answers
433 views

What is special about an entropy count (RNDGETENTCNT) of 160 for libsodium initialization?

(Moved from StackOverflow) In the Usage documentation for libsodium, before calling the initialization function sodium_init, they suggest you check the entropy ...
3
votes
0answers
94 views

How good is the middle cube method with jumbled digits? [closed]

I had to make my own PRNG for a stream cipher for an inter-school science project. So I thought of cubing the seed instead of squaring it (like in the middle square method). And to prevent prediction ...
2
votes
3answers
3k views

Estimating random number entropy for input into 256 bit hash

Assuming a random number generation process outputs lots of numbers between 0-9. First I gathered up a bunch of the numbers, converted them to binary and created a bitmap. Not so random as you can ...
1
vote
2answers
113 views

Why doesn't the ability to sample a single random bit imply the construction of a random oracle?

I'm trying to understand exactly how the random oracle model differs from the standard model. In many proofs & applications there are some assumptions that some randomness is sampled (i.e. a bit $...
1
vote
1answer
244 views

Sub exponentially hard OWF , PRF and iO

I'm currently reading the work "Obfuscation of probabilistic circuits and Applications' by Canetti Lin Tessaro and Vaikuntanathan 2015. It says sub exponentially hard OWF implies sub exponentially ...
1
vote
1answer
169 views

In a specific Paillier implementation, why is r prime?

I have a question about an implementation of the Paillier cryptosystem. In the description of Paillier above, encryption of a plaintext message $m$ on $\mathbb {Z}_{n^{2}}$, $0\leq m<n$, proceeds ...
0
votes
2answers
3k views

Are mouse movement coordinates useful as a seed for a RNG?

Is it good to use a mouse movement as a 64-bit random seed for a Pseudorandom Generator like AES in Counter Mode? Should I only need to get the X and Y coordinates of the mouse movement?
7
votes
3answers
1k views

Is LUKS Anti-Forensic information splitter (AFsplit) indistinguishable from random data?

I want to know if AFsplit(random_data_input, stripes, digestmod=sha) output is indistinguishable from random data. The attacker ...
5
votes
3answers
555 views

Is this truly a TRNG?

As an appendix for my bachelor thesis, I proposed a solution for a TRNG that uses JPEG images as entropy source. It's open source and available on GitHub. My question is: can this be really ...
5
votes
2answers
1k views

Impact of the hash algorithm on a PRNG

Pseudorandom number generators often use hash functions for the generation. Some applications allow the users to choose this hash function, for example OpenVPN. From the OpenVPN manual: --prng alg ...
5
votes
2answers
2k views

Where do key generation algorithms take the randomness from?

I was just wondering, because in many encryption tools like Veracrypt or GnuPG you have to generate pseudo randomness with your mouse movement. So, where do automatically generated keys take that ...
4
votes
3answers
190 views

How to thwart a cleartext message's size?

Here is a question I don't find addressed in my cryptography books: let's say Alice want to send Bob a message of length N. what is the proper way for Alice to hide N? I am thinking Alice should do ...
4
votes
1answer
2k views

Reusing the random exponent for ElGamal encryption with different plaintexts

In the basic ElGamal encryption scheme, we encrypt a message $m$ as $(g^r, h^r m)$, where $g$ is the group generator and $h$ is the public key of the recipient. If the sender has another message $m'$ ...
4
votes
4answers
1k views

Randomized algorithms and the one time pad

The way I understand it, an algorithm is said to be randomized if it uses randomness as part of its logic (quoting Wikipedia). Now, in the case of encryption algorithms, I assume this means that for ...