prng

Finding seeds for a 5 byte PRNG

那年仲夏 提交于 2019-12-04 05:49:58
An old idea, but ever since then I couldn't get around finding some reasonably good way to solve the problem it raised. So I "invented" (see below) a very compact, and in my opinion, reasonably well performing PRNG, but I can't get to figure out algorithms to build suitable seed values for it at large bit depths. My current solution is simply brute-forcing, it's running time is O(n^3). The generator My idea came from XOR taps (essentially LFSRs ) some old 8bit machines used for sound generation. I fiddled with XOR as a base on a C64, tried to put together opcodes, and experienced with the

How (if at all) does a predictable random number generator get more secure after SHA-1ing its output?

折月煮酒 提交于 2019-12-04 03:39:52
This article states that Despite the fact that the Mersenne Twister is an extremely good pseudo-random number generator, it is not cryptographically secure by itself for a very simple reason. It is possible to determine all future states of the generator from the state the generator has at any given time, and either 624 32-bit outputs, or 19,937 one-bit outputs are sufficient to provide that state. Using a cryptographically-secure hash function, such as SHA-1, on the output of the Mersenne Twister has been recommended as one way of obtaining a keystream useful in cryptography. But there are no

Is java.secure.random a sufficient choice for gambling industry?

試著忘記壹切 提交于 2019-12-04 03:21:36
问题 Java provides an cryptographically secure random number generator in the package java.secure.random. Is it possible to use this number generator if I consider things like seeding and cyclic re-instantiation of the RNG? Or can I use the number generator 'as it is'? Has anyone experience with this generator? EDIT : the requirements are: a) Be statistically independent b) Be fairly distributed (within statistically expected bounds) over their range c) Pass various recognized statistical tests d)

Is it possible to reverse a pseudo random number generator?

陌路散爱 提交于 2019-12-03 12:42:15
Is it possible to reverse a pseudo random number generator? For example, take an array of generated numbers and get the original seed. If so, how would this be implemented? Jonathan Basile This is absolutely possible - you just have to create a PRNG which suits your purposes. It depends on exactly what you need to accomplish - I'd be happy to offer more advice if you describe your situation in more detail. For general background, here are some resources for inverting a Linear Congruential Generator: Reversible pseudo-random sequence generator pseudo random distribution which guarantees all

Pseudo-random number generator for cluster environment

时光总嘲笑我的痴心妄想 提交于 2019-12-03 04:34:46
问题 How can I generate independent pseudo-random numbers on a cluster, for Monte Carlo simulation for example? I can have many compute nodes (e.g. 100), and I need to generate millions of numbers on each node. I need a warranty that a PRN sequence on one node will not overlap the PRN sequence on another node. I could generate all PRN on root node, then send them to other nodes. But it would be far too slow. I could jump to a know distance in the sequence, on each node. But is there such an

Pseudo-random number generator for cluster environment

泄露秘密 提交于 2019-12-02 17:45:33
How can I generate independent pseudo-random numbers on a cluster, for Monte Carlo simulation for example? I can have many compute nodes (e.g. 100), and I need to generate millions of numbers on each node. I need a warranty that a PRN sequence on one node will not overlap the PRN sequence on another node. I could generate all PRN on root node, then send them to other nodes. But it would be far too slow. I could jump to a know distance in the sequence, on each node. But is there such an algorithm for Mersenne-Twister or for any other good PRNG, which can be done with a reasonable amount of time

Generating a Pseudo-random sequence of plus/minus 1 integers

只愿长相守 提交于 2019-12-02 05:07:28
问题 Can anybody help me create a simple pseudo-random sequence of +-1 integers with length 1000 using Matlab? I.e. a sequence such as -1 -1 1 1 -1 -1 1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 I tried using this code below but this is the RANGE -1 to 1, which includes 0 values. I only want -1 and 1. Thanks x = randi([-1 1],1000,1); 回答1: You can try generating a random sequence of floating point numbers from [0,1] and any values less than 0.5 set to -1, and anything larger set to 1: x = rand(1000,1); ind =

Issues with seeding a pseudo-random number generator more than once?

江枫思渺然 提交于 2019-12-01 18:12:52
I've seen quite a few recommendations for not seeding pseudo-random number generators more than once per execution, but never accompanied by a thorough explanation. Of course, it is easy to see why the following (C/C++) example is not a good idea: int get_rand() { srand(time(NULL)); return rand(); } since calling get_rand several times per second produces repeated results. But wouldn't the following example still be an acceptable solution? MyRand.h #ifndef MY_RAND_H #define MY_RAND_H class MyRand { public: MyRand(); int get_rand() const; private: static unsigned int seed_base; }; #endif MyRand

Issues with seeding a pseudo-random number generator more than once?

一曲冷凌霜 提交于 2019-12-01 17:54:23
问题 I've seen quite a few recommendations for not seeding pseudo-random number generators more than once per execution, but never accompanied by a thorough explanation. Of course, it is easy to see why the following (C/C++) example is not a good idea: int get_rand() { srand(time(NULL)); return rand(); } since calling get_rand several times per second produces repeated results. But wouldn't the following example still be an acceptable solution? MyRand.h #ifndef MY_RAND_H #define MY_RAND_H class

Is java.secure.random a sufficient choice for gambling industry?

你。 提交于 2019-12-01 17:34:34
Java provides an cryptographically secure random number generator in the package java.secure.random. Is it possible to use this number generator if I consider things like seeding and cyclic re-instantiation of the RNG? Or can I use the number generator 'as it is'? Has anyone experience with this generator? EDIT : the requirements are: a) Be statistically independent b) Be fairly distributed (within statistically expected bounds) over their range c) Pass various recognized statistical tests d) Be cryptographically strong. As others say, the secure RNG can have limited throughput. To mitigate