Here you can find the source of generateSalt(int byteSize)
public static byte[] generateSalt(int byteSize)
//package com.java2s; //License from project: Open Source License import java.security.SecureRandom; import java.util.Random; public class Main { private static final Random r = new SecureRandom(); public static byte[] generateSalt(int byteSize) { byte[] salt = new byte[byteSize]; r.nextBytes(salt);/*from www . java 2 s .co m*/ return salt; } }