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
1
vote
1 answer

error in parallel RNG

I generate a series of random numbers in parallel, but depending on what number of threads I invoke, I get a different result. From that I conclude that I have made an error somewhere! NOTE I am using the same seed, which is independent of the…
BillyJean
  • 1,537
  • 1
  • 22
  • 39
1
vote
1 answer

How can I generate a cryptographically strong sequence of random bytes from a seed?

How can I generate a sequence of cryptographically strong random bytes from a seed value (so that the sequence can be regenerated from the same seed again)? Are there maybe any good CSPRNG algorithms that I could implement in C# (preferably with…
Sam
  • 7,252
  • 16
  • 46
  • 65
1
vote
3 answers

Lua 4.0 random number generator

I don't have access to random() in Lua 4.0 (DON'T ASK), so I need to roll my own random number generator. Or rather I have to roll another one since the one I implemented several years ago is failing me now. I.e. I am noticing repeating values which…
posfan12
  • 2,541
  • 8
  • 35
  • 57
1
vote
2 answers

CURAND properties of generators

CURAND comes with an array of random number generators, but I have failed to find any comparison of the performance (and randomness) properties of each of them; mostly, I'd be interested in which generator to use for which application to gain…
Florian Mayer
  • 3,041
  • 24
  • 17
1
vote
1 answer

Understanding this 16-bit PRNG

I found this algorithm for a 16-bit PRNG. I don't understand what x, y and t are. What I want to do is use a 16-bit seed to generate multiple random 16-bit values. If I'm correct, the function shown in that webpage (quoted below) is only pseudo…
Jodes
  • 14,118
  • 26
  • 97
  • 156
1
vote
1 answer

Incorporating boost random number generator as a class variable

I'm trying to create a wrapper class for the boost random number generator, based on http://www.sitmo.com/article/generating-random-numbers-in-c-with-boost/. The problem is that boost uses templates and I don't know how to separate the declaration…
purple51
  • 319
  • 1
  • 8
1
vote
0 answers

How to test short period PRNGs?

So in short my question would be this: How one should test a short period PRNG? Emphasis being on short period, like from 2^8 up to at most 2^32. These small generators may have more compact and faster code, small state, might making them suitable…
Jubatian
  • 2,171
  • 16
  • 22
1
vote
4 answers

Pseudorandom Sequence Generator not just a number generator

I need an algorithm that pretty much will turn a unix timestamp into a suitably random number, so that if I "play back" the timestamps I get the same random numbers. And here's what I mean by suitably: Most humans will not detect a loop or pattern…
Sam Washburn
  • 1,817
  • 3
  • 25
  • 43
1
vote
2 answers

Get Negative Numbers With OpenSSL Random In PHP

I'm messing around with some code to make a strong pseudo-random number generator using PHP. So far, I have the following. function strongRand($bytes, $min, $max) { if(function_exists('openssl_random_pseudo_bytes')) { $strong =…
425nesp
  • 6,936
  • 9
  • 50
  • 61
1
vote
4 answers

Cryptographically secure PRNG's in C

I'm working on generating very large random integers in C. I've found that /dev/random is a good source, but it blocks if the entropy pool is exhausted. /dev/urandom seemed like the next goto, but the quality of randomness is not as good in…
JessMcintosh
  • 460
  • 2
  • 6
  • 21
1
vote
4 answers

How many random number generators should I use?

If different classes of an application need to extract one or more random numbers, where should a random number generator be initialized in order to produce good random sequences? In particular, I need to build some decision trees in order to train…
enzom83
  • 8,080
  • 10
  • 68
  • 114
1
vote
1 answer

Is this function preimage resistant?

One of the ways of testing strength of PRNG functions is to design tests that distinguish PRNG outputs from random strings: we are given a box which outputs PRNG(u) for some u or a random string. We have to determine if the output comes from…
zie1ony
  • 1,190
  • 2
  • 14
  • 33
1
vote
2 answers

Argument-dependent PRNG

I am interested in a function rand(x, y, seed) that returns (pseudo) random numbers based on its arguments, with the following properties: The value returned should depend on its 3 arguments, and not depend on the amount of times rand was called so…
IVlad
  • 43,099
  • 13
  • 111
  • 179
1
vote
2 answers

What is a good value to seed a stdgen

I need to find a good value to feed into mkStdGen as a seed. The first thing I'd normally do is just use the ticks since the beginning of the epoch, however, to do that I use getClockTime from System.Time, which according to hackage is deprecated,…
Khanzor
  • 4,830
  • 3
  • 25
  • 41
0
votes
1 answer

Error compiling C++ file using g++

I am using g++ from cygwin, I am trying to compile a .cpp file but I am encountering an error, here is the code: #include "randomc.h" #include // Define time() #include // Define printf() #include…