I have a Wordpress hashed password database. I am trying to verify a user password for a stored database password, but the hashes are not correct. I am using this github code with some input in isMatch() . Any ideas why these passwords don't match? plaintext password alberta10
public boolean isMatch(String password, String storedHash) {
Here is my authenticate() method
private void authenticate(String username, String password) throws Exception { // Throw an Exception if the credentials are invalid PasswordHasher pwdHasher=new PasswordHasher(); _logger.log(Level.INFO, "----Authenticating user: "+username); try{ Connection conn=authenticationBiz.connWordpressDB(); String query = "SELECT * FROM wp_users WHERE user_login = ?"; PreparedStatement preparedStmt = conn.prepareStatement(query); preparedStmt.setString(1, username); ResultSet rs=preparedStmt.executeQuery(); rs.next();//get first result _logger.log(Level.INFO, "----Hashed pwd from db is: "+rs.getString("user_pass")); if(pwdHasher.isMatch(password,rs.getString("user_pass"))) return; } catch(Exception e){ _logger.log(Level.INFO, "----Exception in Authenticating user: "+e); throw e; } throw new Exception(); }
Here is the log output:
----Hashed pwd from db is: $P$BeatnTVG2/U8KZwpaWbPUF4yghHEKf. 17:21:40,997 INFO [com.mollom.phpass] (default task-37) ----Hashed pwd from db is: $P$BeatnTVG2/U8KZwpaWbPUF4yghHEKf. ----Hashed pwd using php-pass: $P$BeatnTVG2etvrth3rlCUdiNRm93PO9xZjXNr1f5s8izUZFfIq70V
source share