import java.nio.charset.Charset;
import java.security.*;
import java.util.Arrays;

public class PasswordHash {
	
	
	public static void main(String[] args){
		
		//Checks the installed security Providers
		Provider[] providers = Security.getProviders();
		
		for(Provider prov : providers){
			System.out.println(prov.getName());
		}
		
		//Use an SecureRandom object
		
		SecureRandom sr = new SecureRandom();
		//SecureRandom sr = SecureRandom.getInstanceStrong();
		//SecureRandom sr = SecureRandom.getInstance("SHA1PRNG", "SUN");
			
		byte[] salt = new byte[20];
		sr.nextBytes(salt);
		System.out.println(Arrays.toString(salt));
		System.out.println(new String(salt,Charset.forName("ISO-8859-1")));
			
	}
	
}
