Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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

random change of PRNG seed during cyphering process [migrated]

I use a home made python script for private local storage using XOR one-time-pad. The key file is generated by using the PRNG provided by the "random" built-in module of python. As the size of the ...
1
vote
1answer
31 views

Can the OpenSSL random number generator be considered cryptographically secure? [duplicate]

The OpenSSL Random Number generator documented here uses an OS-provided entropy source coupled with a MD5 hash function. Does it impact the quality of randomness to use a broken cryptographic hash ...
3
votes
0answers
109 views
+100

Any speed up methods for finding the index of a random value produced by the Inversive congruential generator?

The Inversive congruential generator produces random values with: $$x_{n+1} = a\cdot x_{n}^{-1} + b \mod P$$ (special case if $x_n=0$ -> $x_{n+1}=b$) starting with an initial value $x_0$ With well ...
1
vote
1answer
48 views

What is the correct way to choose the start parameters for NIST tests? [duplicate]

I had an idea of creating a pseudo-random binary sequence with that code: ...
1
vote
2answers
79 views

Is it possible to use an algorithm to generate an OTP?

I am a software developer, not a cryptologist. I like the idea of perfect secrecy and would like to use a one-time pad (OTP) to encrypt/decrypt files up to, say, 50Mb. Is there a way that I can use ...
1
vote
1answer
40 views

Problem with Hash-DRBG's seedlen values (and others)

In NIST-SP-800-90Ar1, the Hash-DRBG is instantiated with hash functions using strange values for seed length (seedlen) such as 440, 888. How are these values derived? How to derive values for other ...
2
votes
1answer
43 views

NIST DRBG algorithms' optional parameter

As I'm going through NIST-SP-800-90Ar1 spec for DRBG, I found the mention of security_strength in all of the 3 specified construct in the document: Hash_DRBG, HMAC_DRBG, CTR_DRBG. However, they're all ...
1
vote
0answers
66 views

'random' function $r_{n+1} = f(r_n)$, $|\{r_i,\forall i\}|=N$, $r_N = r_1$ where a function $g(r_k)=k$ is harder than in ECC?

Is there a deterministic pseudo random function $f$ with $r_{n+1} = f(r_n)$, $|\{r_i,\forall i\}|=N$, $r_N = r_0$, (for given random initial value $r_0$) where a function which derives the index of a ...
2
votes
1answer
39 views

Randomness measure of a sequence over a finite set [duplicate]

If $S$ is a finite set (such as outcomes of a dice). If I have a sequence $x_0 ... x_n$ of elements over $S$, how can I measure randomness quality of such a sequence as compared to measuring quality ...
-1
votes
1answer
64 views

Is a number generator based on hashing an incremental string and a seed considered random? Part 2

Sorry I didn't put enough details on my last question, I didn't expect that there is really lots of factors, so most answers were left for speculations. In this question, I will give the scenario I am ...
1
vote
2answers
86 views

Is a number generator based on hashing an incremental string considered random?

Consider the following system 1 - fixed string as a seed, example "something" 2 - concat an increment number "something-1" 3 - hash it, assume it is "9f2054ea4d2c" 4 - take the first 3 digits to ...
2
votes
1answer
104 views

“Jitterentropy” vs CPU RDRAND in VeraCrypt 1.24

Veracrypt 1.24 just came out. It uses a true random number generator based on hardware events; namely, on CPU timing jitter, or "Jitterentropy". As an alternative to CPU RDRAND, I am a bit jittery ...
1
vote
3answers
176 views

How can I quickly generate thousands of letters randomly, and strongly mitigate the risk of any compromise?

I want to generate English letters in a truly random manner without resorting to hand-thrown dice, despite their advantages. Rolling dice would be too slow and tiring as I need four thousand letters. ...
0
votes
0answers
23 views

Is there a 'chain-function' which allows computing the value for the index which is next, previous, +/- some constants but has no shortcut for other?

Looking for an algorithm which has a cyclic 'chain'-function which only allows the computation of next, previous element and in addition to that also a shift by a small amount of constants. Example 1 ...
0
votes
1answer
36 views

What PRG expansion factors are safe?

I'm trying to better understand the "cost" of randomness usage/generation in practice. I understand that generally, some (small) amount of "true" randomness is generated, and then a CSPRNG is applied ...
1
vote
3answers
102 views

Why does mt19937 fail the universal test in NIST SP 800-22?

Update: with the help of @SqueamishOssifrage and @PaulUzdak, we discovered that my NIST SP 800-22 has a broken universal test. So this becomes a moot question. Check this report. It seems to sail ...
0
votes
0answers
38 views

Do any block cipher encryption functions (or similar functions) exist which are associative to each other and cyclic?

Most block ciphers encrypt a plaintext deterministically into a ciphertext which allows decryption in the opposite direction. Now, instead of encrypting just one plaintext, I'm looking for a cyclic '...
1
vote
1answer
85 views

What is the most secure/reliable CSPRNG currently available? [closed]

In terms of period length, uniformity/distribution, what is the most secure/reliable CSPRNG currently available?
0
votes
0answers
31 views

Help, Feedback and Solutions to a problem on a PoC CSPRNG

Background I do not recommend trying to roll your own crypto. This is just a for-fun PoC, which won't be used in any public or private scenario. I am creating a PoC nearly-true random number ...
31
votes
6answers
4k views

What is the practical impact of using System.Random which is not cryptographically random?

I recently noticed a .NET software using PBKDF to derive an encryption key from a password string. This password string was ...
0
votes
1answer
59 views

How can I estimate the amount of entropy (with JavaScript) that I'm seeding a CSPRNG with?

I am trying to determine how much entropy is going into a specific CSPRNG in JavaScript, but I can't seem to find a pure-JS client-side implementation of an entropy estimator. So, I need to find a ...
0
votes
1answer
66 views

Different ways of building a ChaCha20-based RNG

Let's say you're building RNG with ChaCha20 and the fast key erasure technique. There seem to be a few ways to do it. The reference implementation in the SUPERCOP benchmarking toolkit looks like ...
2
votes
2answers
138 views

Efficient way of generating a random number of N (less than 64) bits with exactly M bits equal to one [closed]

Would there be an efficient way to implement a function with the following signature: unsigned long long int random_word(size_t n, size_t m) that would generate ...
2
votes
1answer
51 views

Why does the NIST CTR DRBG apparently output the internal state when no additional input is given?

After reading through the specification of the FIPS CTR_DRBG in SP 800-90A (see Section 10.2.1), I got the impression that the output of the DRBG coincides with its internal state as long as no ...
3
votes
2answers
89 views

Are there any practical differences between running a PRNG on a subset of bits from an RNG compared to running the RNG?

Given an RNG and a PRNG. We define RNG(k) to mean that the RNG produces k random bits. We define PRNG(k, seed) to mean that the PRNG uses seed to produce k pseudo-...
1
vote
1answer
32 views

Side-channel resistant discrete uniform sampling on $d\neq 2^t$ values?

Assume you have some source of $\mathsf{Bern}(1/2)$'s (probably some CSPRNG in practice). What is generally done to sample from $\mathsf{Unif}([d])$ in a side-channel resistant way (assuming $d$ isn't ...
1
vote
1answer
90 views

Interpretation of certain results of NIST Test Suite

I am using NIST Test suite on a PRNG and have a confusion regarding some specific results. Following is the part of the results: ...
1
vote
2answers
49 views

Derive operations from an arbitrary number

I don't really know how to phrase this question, so I'll just mention the idea. This is partially reminiscent (at least in spirit to white box crypto): Can one derive arithmetic operations from a ...
-2
votes
1answer
44 views

Given a point $c$ in a field $Z_p$. Can we get another value $c^{'}$ such that $\left(c^{\prime}-c\right)$ is invertible in $Z_p$?

If we have a point in a field $c$. Can we get another value $c^{'}$ such that $\left(c^{\prime}-c\right)$ is invertible in $Z_p$ ?
3
votes
1answer
182 views

Asymmetric CSPRNG where the public key only works backward

Is there an asymmetric cryptographically secure pseudo random number generator in which the public key only goes backward? For example, I'd like to generate 5,000 digits, then provide the public key ...
16
votes
3answers
3k views

Can we assume that a hash function with high collision resistance also means a highly uniform distribution?

I want to use a hash function to generate a random sequence from number 0-n. And so I would like to find a good function that results in values that are seemingly random (does not need to be secure), ...
3
votes
2answers
97 views

Does a regularly reseeded PRNG provide backtracking resistance?

I'm currently discussing a security topic with some of my classmates. A cryptographic PRNG typically provides backtracking resistance if an adversary that compromises the internal PRNG state cannot ...
2
votes
1answer
80 views

Mapping between NIST test and TRNG features

Each of the NIST tests are generally explained in Random Bit Generation - Guide to the Statistical Tests. I was wondering if some one can help me understand them better. For example, which tests show ...
1
vote
1answer
126 views

Understanding $\varepsilon$-advantage in cryptographically secure deterministic RNG

In Efficient and Secure Pseudo-Random Number Generation by Vazirani & Vazirani, it is stated that every pseudorandom number generator which satisfies the XOR Condition can securely output $\log n$ ...
1
vote
1answer
76 views

Stream cipher — Are all random bit generators suitable for stream cipher?

I learned the stream cipher using LFSR in the book. I wonder whether all random bit generators (i.e. BBS, Rabin generator) are suitable for stream cipher. I search using keywords "stream cipher" and "...
2
votes
0answers
41 views

Is it possible to use a XOF function as csrng? [duplicate]

Let's say we "seed" a xof function (eg. SHAKE256) with x cryptographically random bytes (enough so that they can't be bruteforced), could said function be used as a cryptographically secure random ...
1
vote
1answer
90 views

Why is LCG PRNG chosen to be as c++ rand() function?

The C++ rand() function is an Linear Congruential Generator (LCG) PRNG. my questions are: Why was this algorithm chosen? What are the pros and cons? Is it good for cryptography?
5
votes
1answer
150 views

Using a non-secure random generator for IV or salt generation

I was just looking at a post on Code Review when I noticed the other answer to the post. While I would agree mostly with the answer, I do however doubt if having a Cryptographically Secure PRNG is ...
4
votes
3answers
228 views

Can a deck of cards be used as a practical source of cryptographic randomness?

This is not a duplicate of Entropy measurement from shuffled cards, as this concerns use of cards as a cryptographic entropy source, rather than calculating entropy from some number of cards. The ...
9
votes
1answer
2k views

Is openssl rand command cryptographically secure?

I'm wondering if the openssl rand command produces cryptographically secure random bytes. For example when in need for a random password or token: ...
3
votes
2answers
95 views

How to make a hypothesis test for a simple statistical test for a certain RNG?

I'm self-studying about hypothesis test in the context of RNGs. I'm building a hypothesis test from scratch. I'm taking the simplest statistical test I can think of: how many $1$s are there in the ...
2
votes
3answers
170 views

Are XOFs and KDFs more usable than DRBGs?

CSPRNGs have 2 design requirements: output unpredictability, back-tracing resistance. In addition to which, NIST SP 800-90Ar1 added other features such as a) instance customization/personalization,...
2
votes
2answers
180 views

Why should one model an entropy source in order to build a TRNG?

Some assert that a theoretical model of the unconditioned source must be created when building any TRNG. It's believed to be a fundamental requirement. So a few related questions arise:- What is a "...
-1
votes
1answer
77 views

Brute forcing/hacking Secure passphrases - difficulty for random strings vs real words

I was wondering about this topic of brute forcing passwords,or ANY other way to deriving them - and asking myself whats more secure (relatively): A Password which includes A) 30 digits length- a ...
0
votes
2answers
75 views

secret and unique random number generator within a range

I am trying to think of a way to generate secret and unique random numbers within a range. Say we have a public range [1-n], how could we have a maximum of n users choose a random number within this ...
2
votes
1answer
211 views

What are implementations of PRNGs based on ChaCha20? [closed]

I thought I'd find an implementation in NaCl, but /dev/urandom is what I find. Search engines samples revealed most implementations are broken. What libraries are ...
2
votes
3answers
230 views

Low entropy - how does it compromise the crypto

One of the often pointed out mistake in dealing with crypto is not having enough entropy in the system. Without enough entropy the random numbers generated are not random enough. But what I am not ...
4
votes
2answers
117 views

How was the 5 digit random number in the VIC cipher generated?

Knowing that VIC was a "spy cipher" it is unlikely that the agents used a cryptographic device to genreate the 5 digit number but how did they do it?
5
votes
3answers
535 views

Hardware RNG Bias

I have generator based on sampled noise (reverse-biased transistor - actually ChaosKey but that's not that important). The noise source is fed into ADC and sampled with 16bit resolution (2 bytes). ...
-2
votes
1answer
56 views

Method for generating random number(s) [closed]

I was reading about random numbers and their usage in security. I'd like to verify with more experienced people how good this method of generating random numbers will be. Human beings are very hard ...