If I use the same seed value for Random in a java program and run this on two different machines ,will I get the same set of numbers?
for example
long seed = 123L;//may be taken from some database or something
java.util.Random ran = new java.util.Random(seed);
int ret = 0;
for (int i= 0; i< 10; i++){
ret = ran.nextInt(1000);
System.out.println("ret="+ret);
}
I always get
ret=782
ret=450
ret=176
ret=789
ret=795
ret=657
ret=834
ret=837
ret=585
ret=453
If I run this multiple times on my computer,I would get the same set of numbers.. but suppose someone manages to get the secret seed value I used(by guessing or from the secret location where it was stored) and run this code on his machine,will he get the same set of numbers?
SecureRandom.