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 boolean matchPassword(String planePassword, String encryptedPassword) { BasicPasswordEncryptor en = new BasicPasswordEncryptor(); return en.checkPassword(planePassword, encryptedPassword); }
public static boolean checkPassword(String inputPassword, String encryptedPassword) { BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor(); return passwordEncryptor.checkPassword(inputPassword, encryptedPassword); }
public static String encriptPassword(String userPassword) { BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor(); String encryptedPassword = passwordEncryptor.encryptPassword(userPassword); return encryptedPassword; }