I had to make my own PRNG for a stream cipher for an inter-school science project. So I thought of cubing the seed instead of squaring it (like in the middle square method). And to prevent prediction of the next number, the digits in the cube had to be jumbled using a seed-dependent algorithm which the users had to implement themselves and share along with the seed. Then the middle had to be taken out of the jumbled cube. And also, if the numbers become zero, the next number will be the middle of the jumbled cube of the sum of the seed and any prime number, where the number of digits of the sum is equal to that of the seed.

Is this algorithm by any chance good? Can any one tell me its defects if it has any. And is it random enough?

  • $\begingroup$ Probably not as gumbling may not mean what you think it means. But in general, it would be very beneficial if you could create a more formal protocol (if not mathematical notation then some kind of pseudo code). Modern mathematics only use static algorithms and changing input (keys, seed, salt, iv etc). So using a seed dependent algorithm is not a good idea. Also check Kerckhoff's principle. $\endgroup$ – Maarten Bodewes Nov 3 '14 at 18:14
  • 2
    $\begingroup$ Speaking of seed-dependent algorithms, Knuth's attempt at a randomized-algorithm "super-random" number generator is an enlightening read. $\endgroup$ – Stephen Touset Nov 3 '14 at 19:30