Questions tagged [randomness]
Usage of randomness (i.e. non-predictable data, usually in the form of bits or numbers) for cryptographic purposes.
541
questions
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 ...
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 ...
2
votes
1
answer
485
views
Encryption schemes and pseudorandom permutations
Can an encryption scheme (deterministic or not) be viewed as a pseudorandom permutation taking as input a message and returning a value of the same bit-encoding length?
3
votes
3
answers
569
views
Construct a random permutation from a random function?
How can we construct a (pseudo) random permutation from a (pseudo) random function ?
I've seen a method from Luby-Rackoff which allows to construct a PRP of length $2N$ from a PRF of input/output ...
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/...
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?
4
votes
4
answers
2k
views
random number generator 10-side dice alternative
A lot of sites (e.g. Dirk Rijmenants') refer to 10-side dice to generate random number for one-time-pad. I was thinking about new ways to generate random numbers, letters and passwords. here what I ...
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 ...
1
vote
2
answers
610
views
How secure is passing a MAC to Python's random.seed before using random.choice to generate a MAC?
I'd like to use Python's random.choice seeded with a HMAC-SHA1 tag to generate a MAC encoded in a variable set of chars.
...
2
votes
0
answers
209
views
Correct way to truncate data to a range [duplicate]
2 hours ago I thought I had this figured out, but now I am doubting myself and want someone to validate my algorithm.
I want to take a stream of k trusted random ...
2
votes
2
answers
10k
views
How does the rand() function in C work? [closed]
I want to know how rand() works (even when I don't provide any seed how it produces PRNs?) thanks!
3
votes
2
answers
819
views
How to efficiently generate a stream of independent, but biased random bits?
Usually, in cryptography, one is interested in debiasing a stream of independent (true) random bits, and several algorithms exist to do this. What about the converse? Let's assume I have a stream of ...
1
vote
1
answer
3k
views
How to generate a random polynomial of degree $m$?
I am trying to do a homework in which implement a variation of this paper and I don't know how to generate a polynomial of degree $m-1$. This polynomial is used to generate the $y_0$ and $y_1$ values.
...
5
votes
1
answer
958
views
Crypto puzzle as proof of randomness?
I need an untrusted client to generate a random public/private keypair (in particular, an Ed25519 keypair, which can be generated really fast), but I'm only allowed to see the public key. The ...
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 ...
-1
votes
2
answers
161
views
use the same pad reversed
Suppose I have a random number (eg 625 467 921). I use it once to encrypt a message OTP style, and when I want to use them again, I reverse them (eg to ...
0
votes
1
answer
253
views
Does a playlist of songs or movies mixed together contain enough random enough for OTP key material?
Ok hypothetical scenario. Lets say I want to generate a lot of key material quickly for a one-time pad. This key material will be divided up and used for many different messages in the future.
I ...
4
votes
4
answers
2k
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 ...
1
vote
1
answer
272
views
Conditional entropy
Suppose I have a file with random binary strings of the same length in each line.
If I'm computing the conditional entropy $H(Y|X)$ where $Y$ is the variable string of fixed length $l$ which is ...
4
votes
1
answer
3k
views
How to test distribution of a hash function?
From what I've found, it is generally accepted a cryptographic hash function like SHA-2 has an evenly, randomly distributed output. Is there a way to test this without running through the entire 2^...
-1
votes
1
answer
360
views
data structure of random / compressed data
can anybody explain to me what data structure results after data is compressed? I just try to find out the difference between random data and compressed data, the entropy of both is very high while ...
6
votes
2
answers
867
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 ...
3
votes
2
answers
556
views
Is just a bit of random, "fully random"?
I understand that hashing a datetime is a pseudo-random number, and not good in a security context.
But what about hashing a datetime plus a truly-random but constant string (just a string that an "...
0
votes
2
answers
4k
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?
4
votes
1
answer
585
views
Conforming Randomness To An Alphabet
Imagine that we're trying to create a function to generate a random string conforming to a user-supplied alphabet. That way, users can generate random strings with given characters. Something like:
<...
1
vote
1
answer
207
views
Combatting traffic shape analysis with spurious packets
I was reading a question about combatting traffic analysis, and a thought occured. If I send random junk messages periodically, would that defeat traffic analysis?
The messages would contain some ...
3
votes
2
answers
2k
views
How to decrypt this RSA-like cipher
Suppose we have a RSA-type Modulus $n = pq$ with $p,q$ prime. We also pick a random public exponent $e$ with $\gcd(e,\varphi(n)) = 1$ and compute the private exponent $d$ with $de \equiv 1 \pmod{\...
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 ...
6
votes
2
answers
4k
views
How can encryption involve randomness?
If an encryption algorithm is meant to convert a string to another string which can then be decrypted back to the original, how could this process involve any randomness?
Surely it has to be ...
3
votes
1
answer
375
views
Cryptographically strong pseudo-random seq. generators
If a pseudo-random sequence generator is built so that it uses an n-bit seed and outputs a string that is of length x. Let's say one wants to generate a bit string of length y and uses the previous ...
1
vote
1
answer
744
views
BigInteger in Java and Randomness
I'm looking for some PRNGs and – as I have been using Java for a long period of time – I thought that the BitInteger class, together with the ...
4
votes
1
answer
446
views
Is a subset of a random set still random?
Suppose you have an infinite list of random bytes, and you select the first N bytes that correspond to printable ASCII characters. Is this list of N bytes still as secure (e.g. for the purpose of a ...
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 ...
6
votes
4
answers
2k
views
Stretching a random seed to maximize entropy
I'm using a random number generator that requires me to pass it a big (several kilobytes) pool of random data for initialization.
I've gathered entropy from various system metrics (free memory, ...
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?
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 ...
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 ...
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 ...
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 ...
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 ...