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
0
votes
1answer
36 views

Why does l'Ecuyer reject p-values close to 1?

When applying several tests to a given generator, p-values smaller than 0.01 or larger than 0.99 are often obtained by chance even if the RNG behaves correctly with respect to these tests (such values ...
0
votes
1answer
51 views

On the Acceptability of a Naive Pseudo Random Number Generator

My question is probably both philosophical and technical. Background I was developing a CSPRNG, and I needed to shuffle the bits in one step in the middle of the algorithm - any naive shuffle would ...
5
votes
3answers
3k views

Why is the output of a True Random Number Generator (TRNG) insecure after it has been compressed?

I came across the following statement regarding true random number generators (TRNG): A “P1 medium” [AIS31] true random number generator (TRNG) may not be directly used due to cryptographic reasons. ...
0
votes
0answers
20 views

how to implement the modulus 2^64 in c for linear congruential generator LCG [migrated]

This is an implementation in C for linear congruential generator that has this formula: $$ X_{n+1}=a*X_{n} \bmod m $$ Below are two versions of the linear congruential generator function, the first ...
0
votes
0answers
15 views

(RNG) For the Middle Square Method, is there a table of periods for various seeds?

I'm interested in the properties of the original middle square method as articulated by John von Neumann and in particular in the relation between seed value and its period length (in cases where the ...
1
vote
2answers
75 views

On The Next Bit Test

I would like to know what $O(v(n))$ really means in detailed and simple words please. I found it everywhere in the literature I am reviewing but I cannot find what the intuition of it (especially if ...
2
votes
1answer
73 views

Using AES-CTR as a PRNG

AES-CTR is not considered as a CSPRNG, why ? Is it unsecure to use it when a password is hashed with Argon2id to produce the seed to generate all random data needed for an end-to-end encyption system ...
2
votes
0answers
31 views

RNG and Mersenne twister learning resources for the amateur

I am a complete amateur in the area of random number generators. I would appreciate resources to begin learning. Also I would also like to learn about Mersenne twister. Resources that are easy on the ...
5
votes
1answer
79 views

What quality of randomness is needed for randomized side channel countermeasures?

Using per-operation randomness is a popular and effective way to protect cryptographic implementations against side-channel attacks, e.g. using Shuffling (randomizing the processing order eg for AES ...
1
vote
3answers
123 views

Is random.org truly reliable?

Can someone help me in gaining an understanding of the reliability of random.org being used by a University to select student applicants to extend invitations to?
1
vote
1answer
81 views

Is it possible to create a 128-bit UUID from a weak entropy source?

I am looking at a seemingly popular piece of JavaScript code to generate a UUID which is supposed to be a 128-bit number: ...
4
votes
2answers
130 views

What's the name of this random number generation algorithm?

I'm looking for the name of an RNG method or algorithm, described below. Combining multiple results of a non-uniform random number generator can produce a more uniform result. It seems like this would ...
0
votes
0answers
80 views

RNG to hide some bits

Suppose I have a sequence of bits of length M. I need to hide N out of M bits (hiding means forcing them to be 0) using RNG with a key. How I can relate the output of RNG to the number and positions ...
2
votes
1answer
86 views

Breaking a Mersenne-twister RNG with unsequential outputs

Pardon me for this newbie-ish question. I'm still a novice in cryptography . I have an application that outputs random numbers from 0 - 12 (endpoints inclusive) unsequentially (some outputs are thrown ...
1
vote
0answers
60 views

CSPRNG for Contract Bridge (RAND_MAX = 0xAD55E315634DDA658BF49200)

Some background information: In contract bridge, there are 0xAD55E315634DDA658BF49200 (just under 2^96) possible bridge deals. Since the 1990s, bridge deals for major tournaments were generated on ...
0
votes
0answers
41 views

Understanding a claim made by NIST SP 800-22 on the possibility of calculating $\beta$, the probability of error type 2 in a hypothesis test

NIST SP 800-22 on page 1-4 (that's page 16 of the PDF) states the following. Pay attention to the bold passages. (Emphasis are mine.) Are they true?! Can you advise? One of the primary goals of ...
13
votes
5answers
6k views

Can I encrypt a message by swapping bits in the text?

I have tried out an encryption method, in which I swap bits in the text. The text length is N bit, then I generate several random number pairs in the range 0..N-1, as [n,k] pairs. After that I swap ...
1
vote
1answer
564 views

Practical sources of entropy on an Android device?

What Android API's can be used a practical sources of entropy ? Given the requirement of sourcing entropy on the phone for purposes of seeding a PRNG, what are good options ? Edit: I have a hard ...
0
votes
1answer
77 views

How many 12 bit integers output are required to reverse the Mersenne Twister?

I am creating a web app that applies Python's random algorithm (Mersenne Twister) to generate random 12-bit integers. I am concerned as to how a user can predict ...
0
votes
1answer
79 views

Would knowing the random seed help to break AES or similar?

Consider I knew the seed of the random number generator that Bob uses to send encrypted emails to Alice. Would I have an advantage in deciphering the message? Also, how does, for example, openssl ...
0
votes
1answer
14 views

Allowing third party to verify and/or replay a draw

I’m not an expert in crypto, and I would like to design draw system (like a lottery, but choosing one of the participants), the most open possible, allowing a third party to verify the data/draws, and ...
0
votes
0answers
30 views

When will the random bit sequence start to repeat in pseudo random number generator

Let's say we have the Blum-Micali pseudorandom number generator. from wikipedia: Let $p$ be an odd prime, and let $g$ be a primitive root modulo $p$. Let $x_0$ be a seed, and let $x_{i+1} = g^{x_i}\ ...
0
votes
2answers
64 views

Extracting Randomness from a Poisson Distribution

I'm working on a quantum random number generator based on the shot noise of CMOS camera sensor. Shot noise in an image is caused by the variance of the number of photons hitting the sensor per unit of ...
5
votes
1answer
514 views

Is it possible to construct a PRNG where the output numbers have a certain distribution of hamming weights?

I am in need of a non-uniform random number generator where each n-bit output has a hamming weight with a certain binomial distribution. For example, I would like a non-uniform PRNG which generates ...
3
votes
1answer
97 views

Is it possible to predict a randomly generated BigInteger that uses Java's default Random library?

I've seen it posted on different forms here and here that explain how java.util.Random library uses a linear congruential pseudorandom number generator which can be ...
3
votes
1answer
85 views

Randomness extractors from Bourgain’s breakthrough- applications?

Some exciting progress to pure mathematics is due to Bourgain Springer - Multilinear Exponential Sums in Prime Fields Under Optimal Entropy Condition on the Sources with applications to randomness ...
2
votes
0answers
39 views

Linear approximattion of $(x+y) \bmod 2^n$ in FSM of SNOW 2.0 where $x,y$ in $F_{2}^n$

I would like to understand the linear approximation of $(x+y) \bmod 2^n$ by linear masking method in the paper refereed ""Improved Linear Distinguis'hers for SNOW 2.0" by Kaisa Nyberg and Johan Wall´...
0
votes
1answer
87 views

Pseudorandom number generation predictability

Can you expect with certainty that any pseudo-random number generator will produce the same stream with a shared seed?
1
vote
1answer
92 views

Construct a specific length-doubling pseudorandom generator from a length-doubling pseudorandom

Let $G$ be a length-doubling pseudorandom generator (i.e., for any $n\in \mathbb{N}$ and for any $s\in\{0, 1\}^n$ it holds that $G(s)\in\{0, 1\}^{2n}$). Can you construct a length-doubling ...
2
votes
3answers
113 views

Why can a symmetric encryption algorithm be considered a pseudo-random number generation algorithm?

I have a question from my teacher: "Why can a symmetric encryption algorithm be considered a pseudo-random number generation algorithm? Can anyone explain it to me? And sorry if my english is not ...
18
votes
2answers
4k 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 ...
2
votes
1answer
80 views

If ChaCha20 is being used just as a CSPRNG, is nonce needed?

I'm planning to use ChaCha20 just as a CSPRNG. Key is random (taken from strong initial entropy source) and will be constantly replaced via DJB's fast key-erasure scheme. What should I use as the ...
1
vote
2answers
367 views

Why is Math.floor(Math.random()*9000) not secure in JavaScript?

I heard that one can predict the output from Math.Random() of JavaScript, but another day I had an idea to combine Math.random() ...
2
votes
1answer
171 views

How to get the original list back given a shuffled list and seed?

Say I have a shuffled list that was shuffled in Python using random.shuffle(). The shuffling was performed using a seeded random number generator. Is there a way I ...
8
votes
1answer
761 views

RFC6979: error in reference implementation?

If I correctly understand RFC 6979, there is an error in the ref implementation section 3.2. In the step H2, RFC specification says ...
6
votes
2answers
814 views

How to analyze the off-by-one error's impact on the entropy of the result?

I'm reading Jean-Philippe Aumasson's book Serious Cryptography to learn more about cryptography. On page 37, the author gives an example of Cryptocat's off-by-one error in its PRNG implementation in ...
2
votes
1answer
88 views

Mathematical proof or any reference of “Deterministic random bit generator cannot produce more randomness than the randomness of seed”

The heading tells everything. Any proof or any kind of reference is welcome regarding this: Can we get more randomness from a deterministic random bit generator than the entropy that we feed to the ...
4
votes
1answer
118 views

Murder Mystery Party

For a "Murder Mystery Party", one person is chosen anonymously to be the murderer (i.e., only the murderer knows who the murderer is) by shuffling cards with everyone randomly taking a private card (...
0
votes
1answer
143 views

Dieharder input file with a sequence of only binary numbers

I have a RNG producing sequences of binary numbers, ad I would like to run Dieharder test using them as an ascii txt input file. However I haven't been able to do it properly. Should I use a header ...
2
votes
2answers
92 views

Mathematical definition of deterministic and non-deterministic random bit generators

Can anyone give the mathematical definition of deterministic and non-deterministic random bit generator? Providing a reference will also be very helpful.
2
votes
2answers
89 views

Doesn't d6 to binary for 256-bit bitcoin private key generation produce biased results?

If the mapping table looks like: 1: 000 2: 001 3: 010 4: 011 5: 100 6: 101 Then you are guaranteed that your key will never have a chain of 4 or more 1s, much fewer chains of 3 ones than would ...
7
votes
1answer
137 views

Distance between consecutive primes distribution

In several prime generation schemes I saw we pick a random number uniformly at random from a wide range and find the next prime after it. Obviously with such a scheme some primes are more likely than ...
4
votes
1answer
105 views

Can a PRNG be made into a CSPRNG by hashing the outputs?

So I was contemplating this answer to my last question, and it got me thinking: If I understand it right, one of the required properties of a CSPRNG is that it resists leaking information about its ...
3
votes
1answer
153 views

Is the PCG PRNG a CSPRNG, or why not?

Is the PCG family of PRNG algorithms cryptographically secure, and if not, what about them makes them inadequate for that? I have a good enough understanding of the general problem space that if you ...
2
votes
1answer
65 views

Faster Shuffling for a Simple Application

Alice, Bob, and Charlie are working on three projects. Alice is the manager. At the beginning of each day, she chooses one project to work on (this choice is based on her preferences and is not ...
0
votes
0answers
38 views

NIST Approved Entropy Source List

Per NIST SP 800-90B – Section 3 – Entropy Source Validation : This Recommendation provides requirements for validating an entropy source at a stated entropy rate. Validation consists of testing by an ...
1
vote
1answer
79 views

Min Entropy Value for Health Test per NIST 800-90B for 32 bit Noise Source

NIST 800-90B recommends Section 4.4.1 Repetition Count Test & Adaptive Proportion Test for health test on Noise sources. In the equation to calculate the cut-off value C for Repetition Count Test,...
0
votes
2answers
124 views

PRNG next bit test

I would like to know whether a specific PRNG satisfy the next-bit test or not. will satisfying all of NIST statistical tests on PRNG guarantees passing the next-bit test? Or is there a specific ...
1
vote
1answer
25 views

Does concatinating mutliple digests of hashes from CSRN result in a CSRN?

Kind of a noob question. Suppose; We generate 1,000 cryptographic-ally secure random numbers & store each of them in an array1. For each number in this array1, we take the hash sha256(CSRN) then ...
33
votes
5answers
10k views

The GCD strikes back to RSA in 2019 - Good randomness is the only solution?

When someone collects lots of RSA public modulus, the first thing that comes to mind is; $$\text{GCD them all}$$ If you calculate the GCD of two different RSA modulus and if the result is not 1 then ...

1
2 3 4 5
14