Seed a Secure Random : Secure Random « Security « Java Tutorial






import java.security.SecureRandom;

public class MainClass {
  public static void main(String args[]) throws Exception {
    SecureRandom ran = SecureRandom.getInstance("SHA1PRNG", "SUN");
    ran.setSeed(101L);
    ran.setSeed(101L);
    byte[] seeds = ran.getSeed(24);
    for (int i = 0; i < seeds.length; i++) {
      System.out.println("Seed[" + i + "]:" + seeds[i]);
    }
  }
}








36.40.Secure Random
36.40.1.Secure Random Demo
36.40.2.Generating a Secure Random Number
36.40.3.Seed a Secure Random