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
0 answers
142 views

How to create a CSPRNG seed that can be used to shuffle a deck of cards

I want to generate a seed using CSPRNG. I then want to shuffle a standard pack of playing cards (52) using said seed, however, I want the shuffle to be accurate enough that it covers all the possible ...
1 vote
1 answer
49 views

Where can I find a comprehensive guide to running the NIST SP800-90B_EntropyAssessment?

I am already using the 2 they suggest : https://github.com/usnistgov/SP800-90B_EntropyAssessment https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90B.pdf but, here is where I run into ...
2 votes
1 answer
40 views

exact meaning of ntup in dieharder tests

I'm working with the dieharder package to test a PRNG, but I don't quite understand the ntup parameter. I get that the ntuple should be a set of consecutive bits. ...
  • 21
0 votes
0 answers
25 views

Hash function adapted to work as bactracking resistant PRNG

Let's consider PRNG which is updating its state by using some cryptographically secure hash function. So it takes some input, returns output and this output is a new input. And so on. Of course there ...
  • 1,043
1 vote
1 answer
110 views

Bactracking resistance PRNG - real world usage

I read about bactracking resistance: http://cs.yale.edu/publications/techreports/tr1466.pdf https://arxiv.org/pdf/1810.02227.pdf https://www.schneier.com/wp-content/uploads/2017/10/paper-prngs.pdf ...
  • 1,043
0 votes
0 answers
51 views

Check security of random byte generator

How can I check if the random number generator library that I am using for my app is cryptographically secure or not?
1 vote
0 answers
25 views

Cracking a LCG with tricky parameters

I'm given three values $s_0,s_1,s_2 \in \mathbb{Z}_m$ that follows the recursion formular $s_{n+1} = as_n+b \mod m$. I know $m$ and want to calculate $a,b$. It's easy to see that $a=\frac{s_1-s_2}{s_0-...
0 votes
1 answer
62 views

Secure Random number generator

I am trying to implement a random number generator (which should be cryptographically secure), I am thinking of combining multiple LFSRs, is it a good choice? I've also heard I can create RNGs from ...
0 votes
1 answer
60 views

Seed of pseudo-random number generators

How is the seed of PRNGs generated? They can't be hardcoded I am guessing.
1 vote
1 answer
2k views

Should we really rely on "Cryptographically Secure Pseudo-Random Number Generators" (CSPRNG) alone to guarantee secure random output?

Would it be over-engineering to for example hash the random numbers a random amount of times too, for instance when using the CSPRNG in client-side JavaScript? (assuming this is not the strongest ...
1 vote
0 answers
27 views

Practical demonstration of random number [closed]

I am tasked with creating a practical demonstration of a random number. This means, generating a random number, then showing something practical with it. Does anyone happen to know something practical ...
1 vote
2 answers
83 views

Does the p value in randomness tests provide any real value?

In the dieharder test suite there are things like:- diehard_3dsphere| 3| 4000| 100|0.56011310| PASSED and in the NIST IID (brief mode) and randomness ...
  • 14.1k
16 votes
4 answers
4k views

Is there a cryptographic algorithm that can make a "lottery ticket"?

With public-key cryptography, I know Alice can "seal" a message that only Bob can open. But in that case, Alice knows the message that she is sealing. What if Alice wants to seal a random ...
  • 263
2 votes
1 answer
162 views

Uniform rejection sampling by shifting or rotating bits from CSPRNG output, safe?

Given a CSPRNG (arc4random, using ChaCha20 keystream), one want to use rejection sampling to get random number on a smaller range avoiding modulo bias (arc4random_uniform()). OpenBSD's ...
0 votes
1 answer
47 views

ChaCha Single-Use RNG with All Zero Plaintext + Nonce

I am creating an internal application that will be used to generate and manage self-signed certificates and certificate authorities. Its primary use will be for generating certificates used in SSL ...
  • 145
6 votes
3 answers
144 views

Are small domain keyed permutations inherently unsafe?

In the accepted answer to a question in Computer Science Stack Exchange, it was mentioned that a block cipher in counter mode makes a random number generator with a large bitspace, which visits every ...
0 votes
2 answers
132 views

CS(P)RNG uniqueness

I recently read a StackOverflow post about a CS(P)RNG generating sixteen bytes of random data. The OP wanted this data to be random and unique. One of the answers said that uniqueness and randomness ...
  • 155
1 vote
1 answer
74 views

Predicting the next output of Java Random with bound of 32

I'm trying to predict the next output of random numbers (bounded from 0 to 32) generated by the java.util.Random class. The code is shown below: ...
  • 11
0 votes
0 answers
21 views

Entropy of the Cryptographic Random Number generator within a system

If a crypto generator within a system uses a 256 bit key with - for example - AES-CTR or Chacha20, does having it generate 256 bits actually give you full 256 bits worth of entropy? Does it make sense ...
  • 223
2 votes
1 answer
75 views

Dieharder tests on ATmega328p floating analogue pin A0 passing unexpectedly

Out of interest I wanted to test the results of using a floating analogue pin on my Arduino to generate a sequence of random numbers using dieharder. My working assumption was that it would be a poor ...
  • 21
1 vote
1 answer
52 views

What's the best approach to make PRNGs favourably deterministic a.k.a. biased and how to protect yourself against this?

First of all, I'm not an expert or even a novice in Cryptography. I mean this has certainly been implemented by some scummy PRNG developers, which thought of the economics behind it (especially in the ...
0 votes
0 answers
23 views

Mersenne Twister - Get all outputs from several outputs

First of all, I'm not a programmer nor a cyrptography expert. I was doing some reading at StackExchange on mathematics subjects, and came across Mersenne Twister. And after some readings, many said ...
0 votes
1 answer
117 views

Using system time in nano-seconds as source of entropy in a smart contract

I am working on a smart-contract to be deployed on ETH chain. I am using an oracle(not the company!) system to get the information from off-chain (outside of the blockchain). Basically, we can think ...
  • 101
0 votes
0 answers
23 views

Confirmation of receipt during the fair exchange

Is there a way to confirm the delivery of an item to the recipient e.g(bank payment)? Let's say there is a trust third party in the protocol. The sender's side (honest) says that it sent the payment, ...
0 votes
1 answer
77 views

Is Mersenne Twister hard to break if it has a reduced output?

I was reading this challenge, which proposes to clone (or recover) the internal state of the MT19937 just by applying the inverse process to each output (624 consecutively words). Mersenne Twister's ...
  • 1
0 votes
1 answer
114 views

Is this pseudo random function any good and/or original? [closed]

I designed this pseudo-random function algorithm that takes a uint64 and returns a uint64. I'd like to know if it is any good ...
4 votes
3 answers
324 views

Hotbits vs. Random.org vs. Anything else?

I was searching for a random seed to use with a pseudo-random number generator (not trying to encrypt anything). I went to the following web sites: https://www.fourmilab.ch/hotbits/secure_generate....
1 vote
1 answer
53 views

About two sequence conversion methods in NIST 800-90B

I am reading the 800-90B document. In particular, I'm looking at Chapter 5, the chapter on checking that samples conform to IID. There are 11 tests such as Excursion Test Statistic and Number of ...
  • 99
2 votes
1 answer
92 views

Observations about ENT's Chi Squared test on my own RNG—and HotBits's score

Basic question: ENT seems to trip up generators that pass NIST 800-22 and maybe even dieharder. How do the latter two test suites miss such an obvious failure? There are two things I want to mention ...
  • 51
0 votes
0 answers
78 views

Synchronized random number generation

Let me try to reformulate the problem, as it might help a bit. The requirements are the following: At the beginning of their connection, the two end-points perform a Diffie-Hellman to derive with a ...
  • 323
2 votes
1 answer
91 views

Why does the von Neumann corrector only work when the input bits are independent of each other and same bias?

I read some papers that mention the von Neumann corrector. They always assume that for the von Neumann corrector, the input bits are independent of each other and same bias Why does the von Neumann ...
1 vote
0 answers
96 views

Show that block cipher with CTR is a good PRNG

Assume that block cipher scheme $(KeyGen, Enc, Dec)$ is CPA-secure. Show that $CTR_{Enc_k(0^n)}$ is a good PRNG. Counter mode works as follows: $Y_i = Enc_k(IV + f(i))$ $C_i = Y_i \bigoplus P_i = Y_i \...
  • 123
2 votes
1 answer
111 views

How less secure were those random bytes?

In our Python codebase, some random bytes were generated that we wanted to be cryptographically secure. Previously, the code was: ...
0 votes
0 answers
52 views

recover private keys (RSA)generated with weak LCG

How is it possible to recover RSA private keys considering that weak LCG (random number generator) is used? I have some other keys (Public and private created with the same generator) and also some ...
2 votes
1 answer
53 views

What is the methodology for selecting symbol bit length and window size when performing Shannon Entropy Analysis?

When performing Shannon Entropy analysis on something like an RNG or a file, you must: Select a symbol bit length and number of samples would will perform analysis on at a time (IE: windows size) ...
1 vote
1 answer
92 views

Input size recomendation of sequence for each test in NIST SP 800-22

I am using the NIST SP 800-22 to evaluate the performance of the Random Numer Generator. NIST SP 800-22 has a total of 15 tests. In each test, it has a recommendation for the size of the tested ...
0 votes
0 answers
41 views

Enumerating values from a linear congruential generator java Random()

During my research on a java application, I discovered that the nextInt(64) function of the java.Random() class is used to ...
0 votes
0 answers
32 views

Only DRBG is used for PGP or could use other PRNG?

-RFC4880 refer to DRBG at https://www.rfc-editor.org/rfc/rfc4880#section-16.2 -Could we apply other PRNG such as enocoro/photon for pgp?
  • 51
2 votes
1 answer
89 views

Probability of getting same result from /dev/{u}random

What is the likelihood of getting the same result from /dev/random?
1 vote
1 answer
72 views

Why the DRBG can mask the small deviations in the behavior of the entropy source?

In NIST SP 800-90C, it said:"Small deviations in the behavior of the entropy source in an NRBG will be masked by the DRBG output" Why the DRBG can mask the small deviations in the behavior ...
1 vote
1 answer
74 views

Can we apply the Pseudo Random Number (PRNG) as post processing method for True Random Number (TRNG)?

From the NIST SP 800-90B, we can use these cryptographic algorithms (HMAC, AES, Hash function) as a post-processing technique for TRNG. Besides that, can we apply the Pseudo Random Number (PRNG) as a ...
2 votes
1 answer
144 views

Post processing method for True Random Number Generator

I am finding the post-processing method to improve the randomness of the True Random Number Generator. Especially, TRNG can pass the NIST SP 800-22 after applying the post-processing. I tried to apply ...
1 vote
0 answers
38 views

What is the security of XORing SHAKE256_XOF with itself?

After reading "Can the xor of two RNG outputs ever be less secure than one of them?" I wondered if you can increase security of SHAKE256_XOF by using ...
  • 165
1 vote
1 answer
41 views

About some tests in NIST SP 800-22 rev 1a and erfc function

I'm learning the randomness test of the NIST SP 800-22 rev 1a documentation. https://csrc.nist.gov/publications/detail/sp/800-22/rev-1a/final As I was reading, a few questions came up and I put them ...
  • 99
0 votes
1 answer
102 views

What would be the benefits of a fast PRNG that produces an 8-bit output and could pass 1 Peta Byte of the PractRand test?

Assuming that all other elements like the internal state of the algorithm are considered secured and very hard to discover from a cryptanalytic standpoint. How significant would be for the algorithm ...
1 vote
1 answer
76 views

How to draw words randomly from a physical dictionary?

Suppose I have a real physical dictionary, and I want to draw words from it randomly, using dices. How should I do it? Maybe it's easier to work with a coin since it's easier to convert binary to a ...
  • 13
0 votes
0 answers
134 views

Does xoshiro/xoroshiro PRNGs provide uniform distribution?

It's not clear from the documentation if the sequence of integers produced by these PRNGs belongs to the uniform distribution. Also it's look like there is a whole family of RNG algorithms called in a ...
1 vote
1 answer
65 views

Trimming uniformly random input for elliptic curve private keys

Imagine there is 256-bit uniform input from CSPRNG. Suppose there is a curve like secp256r1 whose curve order is slightly less than 256 bits. We cannot just ...
2 votes
3 answers
205 views

Two untrusting people want to come up with a random number

Two people want to come up with a random number. They don't trust each other nor any third party. What are the known solutions to this problem? I am a quantum cryptography student and am currently ...
  • 121
2 votes
1 answer
159 views

Benefits of hashing a particular seed in a PRNG

This question is linked with this question (stackoverflow) where I asked about a specific implementation detail of Python's random number generator (Mersenne Twister). Here, I have a slightly ...

1
2 3 4 5
16