public static String [ ] encrypt ( String password ) { SecureRandom random = new SecureRandom ( ) ; String salt = new BigInteger ( 130 , random ) . toString ( 32 ) ; String encryptPassword = encrypt ( password , salt ) ; return new String [ ] { encryptPassword , salt } ; }
Encrypt a password string with a random generated salt .