Example #1
0
 public static String hash(String word) {
   try {
     BasicPasswordEncryptor en = new BasicPasswordEncryptor();
     return en.encryptPassword(word);
   } catch (Exception e) {
     return null;
   }
 }
Example #2
0
  /** @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"));
  }
Example #3
0
 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;
 }