Here you can find the source of createSalt()
public static final byte[] createSalt() throws Exception
//package com.java2s; //License from project: LGPL import java.util.Random; public class Main { public static final byte[] createSalt() throws Exception { byte[] salt = new byte[8]; Random random = new Random(); random.nextBytes(salt);/*from w ww .j a va 2 s . co m*/ return salt; } }