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

Simple 2 or 3 parameters float PRNG formula that changes faster than the float resolution and produces white noise?

I'm looking for a 2 or 3 parameters math formula with the following characteristics: Simple (the fewest amount of operations the better) Random output (non-periodic) Normalized (Meaning the output will never be outside a given range; doesn't matter…
TiagoTiago
  • 31
  • 3
0
votes
0 answers

Is this PRNG-function secure?

I have to have a cryptographically secure function,that gives me a random string, for encryption. Is the following function good enough for this? 'PHP' function GenerateRandomString($Length) { $Length /= 2; $cstrong = false; while ($cstrong !=…
Entimon
  • 184
  • 3
  • 11
0
votes
2 answers

Cryptographic secure PRNG-function for PHP?

Is there a good open source script/library for php, that will produce cryptographic secure Pseudo-Random-Numbers?
Entimon
  • 184
  • 3
  • 11
0
votes
1 answer

PRNG with seed in an interval

So my problem is the following : I'm trying to implement in Java a way to encrypt a message M (like from 1 character to let's say 1000) with a password P, chosen by the user (let's say "4z327yU10p"). I then want to hide the message in an image using…
lrosique
  • 113
  • 1
  • 9
0
votes
1 answer

RNG/PRNG using a MSP430

I am currently trying to make a Random Number Generator using a MSP430 (MSP43 G2553) and then create an algorithm for a Pseudo Random Number Generator. I have a code for these two processes and also a code used to test the programs with LEDs. For…
Vladha
  • 3
  • 3
0
votes
2 answers

Roulette Wheel weakness in random number selection

I'm working on a roulette wheel class, it should function more or less like a regular roulette wheel where certain numbers can take up a larger portion of the roulette wheel and thus have a higher probability of being chosen. So far it has passed…
Overly Excessive
  • 2,095
  • 16
  • 31
0
votes
2 answers

A PRNG that doesn't have a period of maximum length

Are there any 32-bit pseudorandom number generators (PRNG) that either have a greater or smaller period than (2^32 - 1)? I would also appreciate a reliable source (book, research paper et.c) that uses it, thanks!
SamTebbs33
  • 5,507
  • 3
  • 22
  • 44
0
votes
4 answers

How does my PRNG implementation differ from the one I'm trying to copy?

I need a PRNG for a simulation project, and found a resource which, given my limited but not nonexistent knowledge of PRNG's seems sound and well-informed. I'm trying to encapsulate the algorithms given in this report in a class, but for some reason…
Tomas Aschan
  • 58,548
  • 56
  • 243
  • 402
0
votes
1 answer

How to exploit a vulnerable pRNG?

Sources often state that if a pRNG has a predictable seed like time of date the resulting output has little entropy and can be exploited. But how do you actually go about exploiting the pRNG? Do you have to watch the output stream for a prolonged…
user2180519
0
votes
2 answers

I need to find an error from this python randint card game

def simple_game(): total = 0 for i in range(0,10): if pick() % 13 != 0 : total = total + pick() % 13 else: total = total // 2 return total after generating a random number (function not shown…
0
votes
1 answer

Determine existence of cycle in number stream - pattern recognition for a cycle

I have tried to make a pseudo Random Number Generator and generated 10000 numbers. I want to determine whether there exists a cycle in it? With my logic, there could be a cycle of maximum length (INT_MAX)**15 - generating and testing till that value…
user3392464
  • 141
  • 1
  • 9
0
votes
1 answer

I want to write a PRNG in C#

What I want to do is procedurally generate game content the same way every time it is rendered without having to render everything in the game until the player reaches that particular section of the game, by using a PRNG. I am trying to write a RTS…
0
votes
2 answers

Looking for PRNG that you can seed with any number bytes

I'm looking for a PRNG (pseudo randomness) that you initially seed with an arbitrary array of bytes. Heard of any?
John Leidegren
  • 59,920
  • 20
  • 131
  • 152
0
votes
1 answer

Math.random vs other random algorithms

I'm using a node.js client application to fuzz a remote server. I can ~100% of the time crash the remote server when using Math.random in the node.js client. However, I've since tried a couple of deterministic, seeded random number generators, and…
Max
  • 2,760
  • 1
  • 28
  • 47
0
votes
2 answers

Are there any linear congruential generator algorithms that return only positive values?

I am aware of one; the ZX Spectrum apparently used a Lehmer RNG with modulus 65537, and multiplier 75. This only generates numbers greater than zero. However, I'd like to use something with a period of more than 2^16 - 1. I'm using this in a…
steve richey
  • 497
  • 3
  • 16