Here you can find the source of generateSalt()
private static byte[] generateSalt()
//package com.java2s; import java.security.SecureRandom; public class Main { private static final SecureRandom RANDOM = new SecureRandom(); private static byte[] generateSalt() { byte[] salt = new byte[24]; RANDOM.nextBytes(salt);//from w ww.jav a 2 s .c o m return salt; } }