Java tutorial
//package com.java2s; //License from project: Apache License import java.security.SecureRandom; public class Main { public static final int SALT_LENGTH = 64; public static byte[] makeSalt() { SecureRandom random = new SecureRandom(); byte[] salt = new byte[SALT_LENGTH / 8]; random.nextBytes(salt); return salt; } }