SecureRandomSaltService.java 371 Bytes
Newer Older
liqin's avatar
liqin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package cn.wisenergy.chnmuseum.party.auth;

import java.security.SecureRandom;

public class SecureRandomSaltService {

	/**
	 * Instance of SecureRandom for generating the salt.
	 */
	private static SecureRandom secureRandom = new SecureRandom();

	public static byte[] generateSalt() {
		byte[] salt = new byte[32];
		secureRandom.nextBytes(salt);
		return salt;
	}

}