Guest User

Untitled

a guest
Jan 23rd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public boolean passwordMatch(String name, String password) {
  2. if (RS2ServerBootstrap.sqlDisabled) {
  3. return true;
  4. }
  5. try {
  6. ResultSet result = database.executeQuery("SELECT password FROM " + PLAYER_TABLE+ " WHERE username='" + name +"'");
  7. ResultSet resultsalt = database.executeQuery("SELECT salt FROM " + PLAYER_TABLE+ " WHERE username='" + name +"'");
  8. if (result.next()) {
  9. String passwordResult = result.getString("password");
  10. String saltResult = result.getString("salt");
  11. String encryptedSalt = MD5Encryption.encrypt("SaltResult");
  12. String encryptedPassword = MD5Encryption.encrypt(password);
  13. String encryptedPassword2 = MD5Encryption.encrypt("encryptedPassword" + "encryptedSalt");
  14. //String passwordResult = ("password" + MD5Encryption.encrypt(salt))
  15. if (encryptedPassword2.equals(passwordResult)) {
  16. return true;
  17. }
  18. }
  19. } catch (SQLException e) {
  20. //ignore
  21. e.printStackTrace();
  22. }
  23. return false;
  24. }
Add Comment
Please, Sign In to add comment