PRINT "hit any key to continue any time after a display and after the graphic display" INPUT "full name of file to be encrypted" nam1$ REM makes the first initial scrambling of this array REM transfering the values from a string into an array then REM subroutine initialize primes the pad array with initial values REM as modifiers in two different ways (or more) REM subroutine setup loads the prime number table REM rbuf% holds the index of the next random number to be used REM then this buffer is used to get new random values
#Pseudo random number generator algorithm mathematica full#
I would take a program like this one I have created and then modify it to pick coordinates: REM $DYNAMICĭIM SHARED trnsltr(66) AS STRING * 1 ' translates a 0-67 value into a pad characterĭIM SHARED trnslt(255) AS INTEGER 'translates a pad value to 0-67 value -1 if errorĭIM SHARED moders(26) AS INTEGER 'modding function prim number arrayĭIM SHARED moders2(26) AS INTEGER 'modding function prim number arrayĭIM SHARED ranbuf(1 TO 42) AS DOUBLE 'random number buffer if this is full and rbuf %>0
On the other hand, the SecureRandom is designed to have the additional feature of being chaotic in regard to the seed. They're designed to have a really, super duper long chain of generated numbers before they start repeating, while having those chains pretty evenly distributed among the number space. Joking aside, random number generators don't necessarily have wildly varying results based on small variations of the seed.
Then hash it 1000 times with a salt that's your birthday concatenated (x+y) times. Start with a hash of your coordinates, then feed the result into a secure random number generator (). Now, you can do all sorts of fun stuff if you're paranoid. Really, any sort of hashing algorithm that has an output space at least as large as an int will do. You can just take the lowest 32 bits for an integer if that's the kind of output you need. There's plenty of space for that kind of population with good ole MD5 (128 bit output). If you're really only looking at 512x512, then that's uh. ImageIO.write(image, "PNG", new File("randomCoord.png")) Short shortSeed = new Random().next(16) as shortĭef image = new BufferedImage(512, 512, BufferedImage.TYPE_BYTE_GRAY) Obviously, this is hardly decent randomness. I tested out Java's PRNG using using this scheme in a quick groovy script, with the following result: What would be a good generator for what I'm attempting? seed is a randomly pre-determined value.īut I must admit, trying to understand all the intricacies of PRNGs is a little overwhelming. Where coord_x_int is the integer part of the coordinate, and the fraction part is given by coord_x_frac / 0xFF. I figured I'd use something like this for the seed: /* 64bit seed value*/ I need to generate repeatable pseudo random numbers based on a set of coordinates, so that with a given seed, I will always generate the same value for a specific coordinate.