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
9 votes
1 answer
7k 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 ...
Mihai Todor's user avatar
7 votes
1 answer
2k views

Correctly generating cryptographically secure pseudorandom numbers (in C)?

I am learning about cryptography, 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, ...
Tom Scrace's user avatar
10 votes
4 answers
4k 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$ ...
Samer Makary's user avatar
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 ...
user avatar
12 votes
1 answer
6k views

Cryptographic security of PHP mt_rand() function using Mersenne Twister algo

At StackOverflow, this question has been asked. It uses additional random entropy and a hash method (among others) to try and create a cryptographically secure pseudo-random number generator for PHP. ...
Maarten Bodewes's user avatar
  • 91.9k
7 votes
2 answers
446 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 ...
zwol's user avatar
  • 775
11 votes
1 answer
2k 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 ...
Bluemilk's user avatar
  • 211
15 votes
2 answers
15k 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
  • 253
4 votes
4 answers
2k views

Efficient random number generator to produce the salt for PBKDF2

I have been looking for an algorithm that generates random numbers and this algorithm has to be secure. I am going to use this algorithm to generate a salt that will be used in PBKDF2. Through my ...
MR.NASS's user avatar
  • 241
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 ...
ThePiachu's user avatar
  • 1,659
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, ...
user avatar
8 votes
2 answers
2k 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.
Jim McKeeth's user avatar
17 votes
8 answers
9k 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
6 votes
2 answers
609 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 ...
Jim McKeeth's user avatar
4 votes
1 answer
549 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 ...
Lunar Mushrooms's user avatar
30 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
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?
Micky W.'s user avatar
  • 111
4 votes
3 answers
607 views

Endless PRNG from PRNG with specific stretch?

Every definition of pseudorandom generator that I've seen says it takes n-bit strings and gives poly(n)-bit strings. Is there a proof that if there is such a pseudorandom generator then there is a ...
user avatar
6 votes
2 answers
317 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 ...
zwol's user avatar
  • 775
8 votes
1 answer
16k views

Can Pre-Paid Cards be cracked?

Is it possible to deduce the original function that used to generate those prepaid cards number that are used for charging your mobile phone credits? For example: If I've collected about 1000 of ...
andre_lamothe'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
6 votes
2 answers
2k views

New PRG from old

Is the following statement true: If $G: \{0,1\}^k \to \{0,1\}^n$ is a PRG, then so is $G':\{0,1\}^{k+l} \to \{0,1\}^{n+l}$ defined by $$G'(x||x')=G(x)||x'$$ where $x \in \{0,1\}^k$ and $x' \in \...
huyichen's user avatar
  • 763
8 votes
3 answers
2k 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 ...
user536's user avatar
  • 141
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
6 votes
3 answers
1k views

Using an RSA private key simultanously as an AES encryption key to generate random numbers?

Currently I'm implementing a PRNG for an embedded system. Using the RFC 4086 I've decided to use the X9.17 - to be more specific the successor X9.31- standard to implement my PRNG. X9.17 uses DES, but ...
user536's user avatar
  • 141
6 votes
2 answers
374 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 ...
fgrieu's user avatar
  • 138k
23 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,967
5 votes
4 answers
1k 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 ...
William Hird's user avatar
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
17 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
  • 3,982

1
13 14 15 16
17