Examples of encryptPassword()


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

    userLogDao.logResetPassword(user, moderator);
  }

  private String setPassword(User user, String password) {
    PasswordEncryptor encryptor = new BasicPasswordEncryptor();
    String encryptedPassword = encryptor.encryptPassword(password);

    jdbcTemplate.update("UPDATE users SET passwd=?, lostpwd = 'epoch' WHERE id=?",
        encryptedPassword, user.getId());

    return password;
View Full Code Here

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

              "(id, name, nick, passwd, url, email, town, score, max_score,regdate) " +
              "VALUES (?,?,?,?,?,?,?,45,45,current_timestamp)",
            userid,
            name,
            nick,
            encryptor.encryptPassword(password),
            url==null?null: URLUtil.fixURL(url),
            mail.getAddress(),
            town
    );
View Full Code Here

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

    BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
    userUpdate = usersRepository.findOne(id);
    if (userUpdate == null || !userUpdate.getEnabled()){
      return false;
    } else {
      userUpdate.setPassword(passwordEncryptor.encryptPassword(password));
      save(userUpdate.getId(), userUpdate);
    }

    return true;
  }
View Full Code Here

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

    UsersService usersService = ctx.getBean("usersService", UsersService.class);
    PreferencesService preferenceService = ctx.getBean("preferencesService", PreferencesService.class);

    BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
    String encryptedPassword = passwordEncryptor.encryptPassword(request.getParameter("pw"));

    if(usersService.findById(request.getParameter("un")) != null) {
      request.setAttribute("registrationMessage", "Username is already taken please regiser with another user name.");
      String url = "/Register.jsp";
      RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url);
View Full Code Here

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

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

     
      // 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

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

        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

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

    userLogDao.logResetPassword(user, moderator);
  }

  private String setPassword(User user, String password) {
    PasswordEncryptor encryptor = new BasicPasswordEncryptor();
    String encryptedPassword = encryptor.encryptPassword(password);

    jdbcTemplate.update("UPDATE users SET passwd=?, lostpwd = 'epoch' WHERE id=?",
        encryptedPassword, user.getId());

    return password;
View Full Code Here

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

              "(id, name, nick, passwd, url, email, town, score, max_score,regdate) " +
              "VALUES (?,?,?,?,?,?,?,45,45,current_timestamp)",
            userid,
            name,
            nick,
            encryptor.encryptPassword(password),
            url==null?null: URLUtil.fixURL(url),
            mail.getAddress(),
            town
    );
View Full Code Here

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

  public void testPasswordEncryptionUsingStrongEncryptor() throws Exception {
    // Declare a strong encryptor
    StrongPasswordEncryptor pe = new StrongPasswordEncryptor();
    // "Encrypt password", is not an real encryption because "Encryptor"
    // generate a digest. by default the SHA-256 algorithm is used
    String encryptedPassword = pe.encryptPassword(TEXT_TO_ENCRYPT);
    System.out.printf("testPasswordEncryptionUsingStrongEncryptor : '%s' become '%s'\n", TEXT_TO_ENCRYPT, encryptedPassword);
    // Valid "encrypted" password
    Assert.assertTrue(pe.checkPassword(TEXT_TO_ENCRYPT, encryptedPassword));
  }
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.