← Back to team overview

cryojs-develoeprs team mailing list archive

[Blueprint mouse-random] Generate random numbers with mouse input

 

Blueprint changed by Robert Arkenin:

Whiteboard changed:
  I would, personally, capture mouse movements using an onmousemove event
  to get the values of window.event.clientX and window.event.clientY, and
  to feed said values into a SHA512 generator, taking the first 256 bits
  for reasons of keeping a random pool unknown. This may be repeated along
  the following algorithm:
  
  1.Generate pseudo-random number
  2.SHA512 it
  3.XOR in mouse coordinates(repeating the same 32-bit integer of (65536*mouseX)+mouseY) upon a mouse movement
  4. SHA512 again
  5. Use 256 least-significant bits of last hashes (using as many hashes as necessary, but never revealing the most significant bits to keep  a pool unknown to attackers)
  6. Upon finishing random data collection, keep said key made from last whatever hashes
+ This will avoid the trouble of the mouse being out of bounds since few users have a 65535x65535 pixel window, and the hash will ensure that even small movements will cause great changes(Avalanche Effect)
+ 
+ 
  -Robert Arkenin (https://launchpad.net/~rarkenin)

-- 
Generate random numbers with mouse input
https://blueprints.launchpad.net/cryojs/+spec/mouse-random