Esempio n. 1
0
 public static String hash(String word) {
   try {
     BasicPasswordEncryptor en = new BasicPasswordEncryptor();
     return en.encryptPassword(word);
   } catch (Exception e) {
     return null;
   }
 }
Esempio n. 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"));
  }
 public static String encriptPassword(String userPassword) {
   BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
   String encryptedPassword = passwordEncryptor.encryptPassword(userPassword);
   return encryptedPassword;
 }