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