Questions tagged [prng]

PRNG - Pseudorandom number generator, A pseudorandom number generator (PRNG), also known as a deterministic random bit generator (DRBG),[1] is an algorithm for generating a sequence of numbers that approximates the properties of random numbers.

See more about PRNG on wikipedia.org

232 questions
5
votes
1 answer

Why is my implementation of the parking lot test for random number generators producing bad results?

I'm trying to write an implementation of the parking lot test for random number generators. Here are the sources that I'm getting my information about the test from: Intel math library documentation and Page 4 of this paper along with the phi…
Chris Dibble
  • 388
  • 1
  • 5
  • 16
5
votes
2 answers

CURAND Library - Compiling Error - Undefined reference to functions

I have the following code which I am trying to compile using nvcc. Code: #include #include #include #include int main(void) { size_t n = 100; size_t i; int *hostData; unsigned int *devData; …
Wilo Maldonado
  • 551
  • 2
  • 11
  • 22
4
votes
3 answers

Getting a random real number in a certain range using WELL512

I'm using the WELL512 pseudorandom number generator function described in this paper. The function returns a random unsigned long value. How do I use this return value to produce a random real number within a certain range - like a float between…
kobarp
  • 43
  • 3
4
votes
3 answers

Do PRNG need to be thread safe?

As long as concurrent calls don't cause seg-v's or return the same value, what reasons are there for preventing race conditions and data corruption in PRNGs when those error's primary effects are unpredictable results and that is the point of a…
BCS
  • 75,627
  • 68
  • 187
  • 294
4
votes
2 answers

Has your pseudo-random number generator (PRNG) ever not been random enough?

Have you ever written simulations or randomized algorithms where you've run into trouble because of the quality of the (pseudo)-random numbers you used? What was happening? How did you detect / realize your prng was the problem? Was switching PRNGs…
Jesse Cohen
  • 4,010
  • 22
  • 25
4
votes
6 answers

Pitfalls of cryptographic code

I'm modifying existing security code. The specifications are pretty clear, there is example code, but I'm no cryptographic expert. In fact, the example code has a disclaimer saying, in effect, "Don't use this code verbatim." While auditing the…
Adam Davis
  • 91,931
  • 60
  • 264
  • 330
4
votes
1 answer

Should the same Random Number Generator be used for multiple crypto operations

Is it recommendable to instantiate an OpenSSL or Crypto++ cryptographically secure random number generator, seed it once, and use it sequentially in multiple cryptographic operations like generating keys, encryption, signing etc.? Will this be be…
SkypeMeSM
  • 3,197
  • 8
  • 43
  • 61
4
votes
1 answer

Internal parallelization by CPU

I've been playing around with Xorshift* random number generators, and I came across this exploration of their properties. Quoting from that site (emphasis mine): How can a xorshift64* generator be slower than a xorshift1024*…
Theolodus
  • 2,004
  • 1
  • 23
  • 30
4
votes
2 answers

Can't quite understand this simple pseudo random generator from Schneier in 1992

Schneier posts at https://www.schneier.com/paper-pseudorandom-sequence.html: int VERYRANDOM() { static unsigned long regA, regB, regC; /*regA, regB, and regC should be initialized with some random value.*/ regA =…
John
  • 6,433
  • 7
  • 47
  • 82
4
votes
1 answer

Java 8 SecureRandom.getInstanceStrong Sources

The documentation for SecureRandom.getInstanceStrong() says that it returns a pRNG instance from the securerandom.strongAlgorithms java.security.Security property. Is there Java documentation that lists these properties by platform?
Cory
  • 748
  • 7
  • 18
4
votes
2 answers

no cryptography random generator seed allowed in C#?

It seems that there is no way to manually seed the RNGCryptoServiceProvider in C#. Is there really nothing simple I can do below to get repeatable randomBytes here for debugging? RNGCryptoServiceProvider rngCsp = new RNGCryptoServiceProvider(); …
bobuhito
  • 285
  • 2
  • 20
4
votes
4 answers

Looking for decent-quality PRNG with only 32 bits of state

I'm trying to implement a tolerable-quality version of the rand_r interface, which has the unfortunate interface requirement that its entire state is stored in a single object of type unsigned, which for my purposes means exactly 32 bits. In…
R.. GitHub STOP HELPING ICE
  • 208,859
  • 35
  • 376
  • 711
4
votes
6 answers

How do I generate 6 random numbers between 1 and 6 using Java?

I am encountering a problem generating 6 random numbers between 1 and 6 in Java. All the numbers have to be unique. When I enter kolon value 5, the arrays should be like this: 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 I don't want the…
Ertuğrul Çetin
  • 5,131
  • 5
  • 37
  • 76
4
votes
2 answers

Reliable and fast pseudo random number generator (PRNG) for Monte Carlo simulation in .net

I use pseudo random number generators (PRNG) to Monte Carlo simulate a queueing type of system. I use System.Random, because it is fast, but found out that it has some weird correlation between subsequent draws, which interferes with the results (it…
willem
  • 2,617
  • 5
  • 26
  • 38
4
votes
2 answers

PRNG not seeded error

i'm getting an intermittent error saying that the pseudo random number generator is not seeded when trying to generate the form auth token. i've copied the relevant part of the stack trace below. here's what i know/see: - restarting passenger seems…
hubert
  • 278
  • 3
  • 12