Java tutorial
//package com.java2s; import java.security.SecureRandom; public class Main { static byte[] generateSalt(int length) { byte[] salt = new byte[length]; SecureRandom random = new SecureRandom(); random.nextBytes(salt); return salt; } }