public static String hash(String word) { try { BasicPasswordEncryptor en = new BasicPasswordEncryptor(); return en.encryptPassword(word); } catch (Exception e) { return null; } }
/** @param args */ public static void main(String[] args) { BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor(); System.out.println(passwordEncryptor.encryptPassword("changeme")); StrongPasswordEncryptor strongPasswordEncryptor = new StrongPasswordEncryptor(); System.out.println(strongPasswordEncryptor.encryptPassword("changeme")); }
public static String encriptPassword(String userPassword) { BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor(); String encryptedPassword = passwordEncryptor.encryptPassword(userPassword); return encryptedPassword; }