creation of (real or pseudo) random numbers (or bits).
48
votes
10answers
3k 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 ...
16
votes
4answers
644 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 ...
9
votes
2answers
536 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 ...
8
votes
4answers
609 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 ...
8
votes
1answer
326 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 ...
6
votes
3answers
2k 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?
6
votes
3answers
381 views
What tests can I do to ensure my PRNG 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?
6
votes
1answer
563 views
Generating Random Primes
Although this has been extensively discussed around here, I'm curious whether my approach makes sense, or I should just stick to "the standard version".
I'm implementing some homomorphic encryption ...
6
votes
3answers
158 views
Does chaining random number generators lead to loss of randomness?
Assume you chain random number generators, i.e use the result of one PRNG as the seed for the next. What kind of errors can that introduce in the randomness of the numbers generated?
6
votes
2answers
1k 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:
...
6
votes
2answers
192 views
Unit testing a library RNG and its seeding for practical security
Suppose I have a cryptography library that provides me with a black-box random number generator that is supposed to be suitable for long-lived key generation. (Under the hood it may be assumed to use ...
6
votes
2answers
297 views
What are the methods to construct a primitive binary nonlinear feedback shift register (NLFSR)?
Given a binary shift register of $n$ bits, a primitive binary nonlinear feedback shift register will generate a sequence with a period of $2^n - 1$.
While I am unable to find a paper which directly ...
5
votes
2answers
306 views
creating a small number from a cryptographically secure random string
i'm trying to figure out the best way to generate a cryptographically secure random number between 0 and 200 from a cryptographically random string of bytes (ie. read from /dev/urandom or some such)
...
5
votes
2answers
485 views
HRNG for One Time Pad
I have just advanced to the last grade of high school (in Denmark). In this year, we all get to do one big project, where we can build/invent/create whatever we want to "solve a problem". As I study ...
5
votes
3answers
1k views
Cracking Pre-Paid Cards
Is it possible to deduce the original function that used to generate those pre-paid cards number that are used for charging your mobile phone credits?
For Example, If I've collected about 1000 of ...
5
votes
1answer
123 views
Correct way to map random number to defined range?
Say that we have a secure random number generation that outputs 32 bit random numbers, so it's output is a true random number between 0 and a MAX.
What is the best way to map this random number to a ...
5
votes
3answers
504 views
ANSI X9.31: the purpose of the date/time vector in the PRNG?
What is the exact purpose of the date/time vector $dt$ in the ANSI X9.31 PRNG?
$$ I := E_K(dt) $$
$$ R := E_K(I \oplus V_{old}) $$
$$ V_{new} := E_K(R \oplus I) $$
Specifically, the document seems ...
4
votes
3answers
207 views
Initialize a PRNG with a password
Let's assume that we have a secure PRNG. Is it "safe" to initialize it with password, or seed based on a password like SHA256(password).
If yes, is it "safe" to generate as RSA or DSA key from it? If ...
4
votes
3answers
249 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 ...
4
votes
2answers
607 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-90 (i.e. based on hash functions), which one is cryptographically stronger?
Hash-DRBG (Section 10.1.1)
...
4
votes
1answer
266 views
How secure is my OTP program?
I'm writing an One-Time Pad encryption program, because I got really interested in the idea of " encryption which has been proven to be impossible to crack if used correctly".
I'm writing the program ...
4
votes
2answers
900 views
Is the following statement about PRG true or false?
Is the following statement true?
If $G: \{0,1\}^k \rightarrow \{0,1\}^n$ is a PRG, then so is $G':\{0,1\}^{k+l} \rightarrow \{0,1\}^{n+l}$ defined as $$G'(x.x')=G(x).x'$$ where $x \in \{0,1\}^k$ and ...
4
votes
2answers
244 views
Predicting PRNG given some of its previous output
I a have a question about PRNGs and this is my very first experience with them. I have the following generator that takes a 56-bit seed 'p' during initialization and then chooses both X and Y randomly ...
4
votes
1answer
155 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 ...
4
votes
1answer
209 views
I need an opinion of encryption method I thought of in High school
First, I'm really not into cryptography, but have some basic knowledge. This was a thought experiment (and later exercise for my programming skills), but even though it was long time ago and I tried ...
4
votes
2answers
137 views
Generating non-repeating N-bit IVs, which are indistinguishable from randomness
I'm implementing a protocol which needs a 64-bit IV for every encrypted packet. The cipher in use (AES-GCM, more or less as specified in RFC 4106) does not require that these IVs are random, only ...
4
votes
2answers
285 views
How many bits can be safely extracted from the BBS generator at each step?
The Blum-Blum-Shub generator is a deterministic Pseudo-Random Bit Generator with security reducible to that of integer factorization.
Setup: Secretly chose random primes $P$, $Q$, with $P\equiv ...
3
votes
4answers
621 views
What is an efficient random number generation algorithm
I have been looking for the algorithm that generates random number and this algorithm has to be more secure.
I am going to use this algorithm to generate the salt that will be used in PBKDF2.
...
3
votes
4answers
371 views
Why isn't the alternating step generator used more often?
According to the Wikipedia entry for the Alternating Step pseudorandom number generator, there is no public cryptanalysis for this device since it was invented back in 1987 by C.G. Gunther. I have ...
3
votes
2answers
115 views
Good enough deterministic PRNG based on hashes
Lets say I have a seed named iv which has a decent amount of entropy.
Are there any glaring issues with the following?
First 64 bytes are generated by SHA512(iv)
Next 64 bytes are generated by ...
3
votes
2answers
194 views
Feedback on rolling my own entropy gatherer
First of all, I don't recommend doing this. This was something I created when I didn't know better and didn't have a solution available to me.
Long ago I created my own entropy gather for a ...
3
votes
1answer
180 views
Are there secure stream ciphers that cannot be parallelized?
Are there any stream ciphers (or a deterministic random number generators, that should work as well I guess?) that cannot be parallelized?
So for example if I seed it with a specific value, and then ...
3
votes
4answers
495 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, ...
3
votes
2answers
238 views
Is ISAAC considered secure as a cryptographic random number generator?
The ISAAC site claims it is secure, but I wasn't aware of any trusted 3rd party sources that verified its security.
3
votes
1answer
129 views
Does hash_df use binary or an ASCII hexadecimal representation for numbers to be passed to the hash function?
I'm implementing the HASH_DRBG algorithm.
As per NIST-SP800 90 document for HASH DRBG Generation, section 10.4.1 "Derivation Function Using a Hash Function (Hash_df)", the Hash_df algorithm contains ...
3
votes
1answer
122 views
Proof that Alternating Step Generator and modifed ASG' have equivalent security?
The Alternating Step Generator (ASG) is a PRNG combining 3 LFSRs. Output of the ASG is the XOR of the output of two clock-gated LFSRs. At each step, a single one of these LFSRs is clocked, according ...
3
votes
2answers
84 views
Can I combine two PRNGs to make use of more seed data?
I have 320 bits of seed data (actually 512 bits of data with 320 bits of entropy, derived from a Diffie-Hellman shared secret and nonces). The PRNG I am using at the moment is the android version of ...
2
votes
8answers
780 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 ...
2
votes
4answers
339 views
Which is more secure using a CSPRNG for a One-time pad, or AES?
In reading about the One-time pad it appears to need truly random key for the pad. Since true random values are not practical to generate this presents a problem (thus making One-time pad less ...
2
votes
1answer
83 views
Is it feasible to break Diffie-Hellman key exchange when the implementation uses a poor-quality PRNG?
I've come across an implementation of DH in Java that uses the Random class to generate the secret integer value $a$, as shown in in Wikipedia's description of the ...
2
votes
2answers
183 views
Is any decent RNG acceptable as a stream cipher?
I have a function f(x,n) that takes a 128-bit key x, and generates n bytes of pseudo-random data. I've tested the output bytes this function for various keys with the NIST RNG testing suite (NIST ...
2
votes
3answers
225 views
PRNG taking advantage of very large seed
Can anyone suggest a good (CS)PRNG algorithm that takes advantage of having a very large (ideally arbitrarily large) seed? I'd like to use several kilobytes, perhaps several hundred kilobytes, of ...
2
votes
1answer
338 views
What is the correct way to generate cryptographically-secure pseudorandom numbers in C?
I am learning about crypto, purely for my own interest. As part of that I am implementing a simple 'one time pad' toolset in C.
Naturally I need to generate random numbers to create the pad, and they ...
2
votes
1answer
70 views
Potential vulnerability in DH key selection - am I understanding this right?
I'm reading through a DH implementation, and I think I found a potential hole.
Public $p$ and $g$ values are properly selected.
A candidate secret value $\bar a$ is pseudo-randomly selected such ...
2
votes
2answers
136 views
How to generate a random integer in interval $[1, 2^n-1]$ from random integer in interval $[0, 2^n-1]$?
For a project I am working on, I have access to a CSPRNG that outputs a random integer in the interval $[0, 2^n-1]$ for any integer $n$ greater than 0. I cannot use the zero values, so I have my RNG ...
2
votes
3answers
246 views
ANSI X9.31 standards for generating random numbers
The NIST-Recommended Random Number Generator Based on ANSI X9.31 Appendix A.2.4
Using the 3-Key Triple DES and AES Algorithms has 3DES being used three times for each 64-bit block of random data ...
2
votes
1answer
140 views
Proving correctness of pseudorandom generator construction given existing pseudorandom generator
Say if I have a given pseudorandom generator G which takes a k-bit input and outputs a 3k-bit number.
How should I show that a specific construction using this pseudorandom generator is valid?
For ...
2
votes
1answer
166 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:
...
2
votes
1answer
202 views
server side Javascript security
It is accepted that the javascript library lacks the ability to create an adequate PRNG. My understanding that this was mainly due to the limits of a sandboxed browser enviroment that javascript ...
2
votes
2answers
126 views
Does a hash function in chaining mode or in counter mode make a better pseudo-random number generator?
I have two pseudorandom generators:
$f_1$ takes a random seed $l_0||r_0$ $\in \{0,1\}^{160}$ as input and outputs $r_1||r_2|| \dots ||r_k$, where $l_i||r_i = \operatorname{SHA-1}(l_{i-1}||r_{i-1})$ ...
