Package org.jasypt.util.password

Examples of org.jasypt.util.password.ConfigurablePasswordEncryptor.encryptPassword()


    pe.setAlgorithm("SHA-512");
    pe.setPlainDigest(false);
    pe.setStringOutputType("base64");
    // "Encrypt password", is not an real encryption because "Encryptor"
    // generate a digest
    String encryptedPassword = pe.encryptPassword(TEXT_TO_ENCRYPT);
    System.out.printf("testPasswordEncryptionUsingConfigurableEncryptor : '%s' become '%s'\n", TEXT_TO_ENCRYPT, encryptedPassword);
    // Valid "encrypted" password
    Assert.assertTrue(pe.checkPassword(TEXT_TO_ENCRYPT, encryptedPassword));
  }
View Full Code Here


     
      // fail.. so see if was a plain text password
        ConfigurablePasswordEncryptor passwordEncryptor = new ConfigurablePasswordEncryptor();
      passwordEncryptor.setAlgorithm("SHA-1");
      passwordEncryptor.setPlainDigest(true);
      String encryptedPassword = (passwordEncryptor
          .encryptPassword(user + settings.readSetting("salt") + pass)).trim();
     
      if(app.logintest(user, encryptedPassword)==null){
//        Util.debug("login failure, took " + (System.currentTimeMillis() - start) + " ms", this);
        return false;
View Full Code Here

        if(app.logintest(user, pass)==null){
         
            ConfigurablePasswordEncryptor passwordEncryptor = new ConfigurablePasswordEncryptor();
          passwordEncryptor.setAlgorithm("SHA-1");
          passwordEncryptor.setPlainDigest(true);
          String encryptedPassword = (passwordEncryptor
              .encryptPassword(user + settings.readSetting("salt") + pass)).trim();
         
          // try plain text
          if(app.logintest(user, encryptedPassword)==null)
            shutDown("login failure: " + user);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.