Home AMX User Forum AMX General Discussion

A better PRNG (random number generator, aka RANDOM_NUMBER replacement)

Hello,

I just wrapped up implementing and testing the ISAAC PRNG in NetLinx, and also some simple code for gathering entropy from device events to seed the PRNG (such as online / offline events from touchpanels, button pushes, etc). While not much in the control world needs a good PRNG, I couldn't sleep last night and thought it'd be a cool idea - plus I have a few ideas of what to do with it :) Is anyone interested in a high-grade PRNG? (then again, we have enough hardware inputs for hardware entropy gathering...but sometimes entropy comes slow, it requires code to be written, and this code is free ;)) Information about ISAAC is here: http://www.burtleburtle.net/bob/rand/isaac.html

Next on my todo list is to implement an open DH and / or public key system as so the system can be validated by third parties, and used for cryptographically secure communications to arbitrary devices. NetLinx may be a bit too limiting for that, though...

Comments

  • a_riot42a_riot42 Posts: 1,624
    A guy gets killed when a 4 seater airplane that had lost its propeller and had its windshield covered in oil glided into the back of him whilst jogging on the beach wearing headphones. How's that for random?
    Paul
  • PhreaKPhreaK Posts: 966
    ^ Ha ha

    Sounds good. I'm currently in the process of putting together a math library for NetLinx that I'll be open sourcing once it's neatened up a little. If you want to merge any of your random number generator implimentations once that's up it could get sexy.

    When it's ready to see the light of day I'll be sure to let the other forum-ites know. Stay tuned.
  • truetrue Posts: 307
    a_riot42 wrote: »
    A guy gets killed when a 4 seater airplane that had lost its propeller and had its windshield covered in oil glided into the back of him whilst jogging on the beach wearing headphones. How's that for random?
    Paul
    Not so great since I can predict it now, and especially since it has logical connections... ;)
    PhreaK wrote: »
    ...Sounds good. I'm currently in the process of putting together a math library for NetLinx that I'll be open sourcing once it's neatened up a little. If you want to merge any of your random number generator implimentations once that's up it could get sexy.
    I wrote a demo project, touchpanel, easily insertable into projects include, etc. and need to test that stuff and the entropy collector module. (The ISAAC code itself is tested and done.) I also need to write some basic documentation on usage and document the functions. I'll bring an NI and TP home tomorrow night to test. Once that's done, I'll post it. Also, I don't intend on writing any different PRNGs - I just wanted something stronger than whatever magic lies behind RANDOM_NUMBER... (EDIT: I may write some faster ones, but due to how systems are usually used, even slow ISAAC may be fast enough.)

    What license do you intend to use for "open sourcing?" Something friendly with the close-it-off crowd?

    EDIT 2: I'll also profile speed between RANDOM_NUMBER() and rand_isaac() as well as run Diehard against RANDOM_NUMBER output.

    EDIT 3: Just need to test the touchpanel demo and it'll be done. While I'm not fond of the license (I tend to use the BSD license), due to past experiences with the community and my belief in openness (especially when it comes to custom integration), the initial release will be under the GPL. I'm not really sure anyone else needs something like this for this to matter, though.
  • PhreaKPhreaK Posts: 966
    I'll be releasing it under the Mozilla Public License, specifically to be friendly to those who don't want to release their code.
Sign In or Register to comment.