Here you can find the source of generateSalt()
private static byte[] generateSalt()
//package com.java2s; //License from project: Apache License import java.security.SecureRandom; public class Main { private static final SecureRandom random = new SecureRandom(); /**/* ww w .j a v a 2 s . c o m*/ * Generate a random salt value of 8 bytes * * @return Salt data */ private static byte[] generateSalt() { final byte[] salt = new byte[8]; random.nextBytes(salt); return salt; } }