Predicting the next Math.random() in Java
franklinta.com
Predicting the next Math.random() in Java
1–10 of 58 posts
Re: Predicting the next Math.random() in Java
#2Re: Predicting the next Math.random() in Java
#3Re: Predicting the next Math.random() in Java
#4Re: Predicting the next Math.random() in Java
#5 for(int i = 0; i
It returns same number for all seeds.Re: Predicting the next Math.random() in Java
#6How dangerous this prediction can be? I can't stop thinking of java-backended real money, poorly written, gaming websites.
Re: Predicting the next Math.random() in Java
#7How dangerous this prediction can be? I can't stop thinking of java-backended real money, poorly written, gaming websites.
Re: Predicting the next Math.random() in Java
#8Example:
var buf = new Uint32Array(10);
window.crypto.getRandomValues(buf);
console.log(buf);
Outputs things like: [4027145128, 258543382, 1205615760, 2665675208, 4033127244,
2280027866, 3983484449, 510932333, 1911490534, 2609399642]
This works in Chrome and FF.IE11 has Crypto.getRandomValues(...)
Java has SecureRandom:
http://docs.oracle.com/javase/6/docs/api/java/security/Secur...
Re: Predicting the next Math.random() in Java
#9How dangerous this prediction can be? I can't stop thinking of java-backended real money, poorly written, gaming websites.
Consumers also don't need to be users, AI players and cards dealt will also consume randomness. You would also need to know the mapping from the random output into the game (e.g. in card games are there multiple decks each assigned 1 value of entropy? 2 decks, 3 decks, etc? Plus any mappings or conversions will make this impossible (as you wouldn't know the real output of the random number generator)).
Ultimately it will likely work pretty reliably locally, but as soon as you stick it on a web service then all bets are off.
Re: Predicting the next Math.random() in Java
#10https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Sp...