Java tutorial
//package com.java2s; import java.security.SecureRandom; public class Main { public static byte[] generateSalt() { byte[] salt = new byte[8]; SecureRandom random = new SecureRandom(); random.nextBytes(salt); return salt; } }