Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean passwordMatch(String name, String password) {
- if (RS2ServerBootstrap.sqlDisabled) {
- return true;
- }
- try {
- ResultSet result = database.executeQuery("SELECT password FROM " + PLAYER_TABLE+ " WHERE username='" + name +"'");
- ResultSet resultsalt = database.executeQuery("SELECT salt FROM " + PLAYER_TABLE+ " WHERE username='" + name +"'");
- if (result.next()) {
- String passwordResult = result.getString("password");
- String saltResult = result.getString("salt");
- String encryptedSalt = MD5Encryption.encrypt("SaltResult");
- String encryptedPassword = MD5Encryption.encrypt(password);
- String encryptedPassword2 = MD5Encryption.encrypt("encryptedPassword" + "encryptedSalt");
- //String passwordResult = ("password" + MD5Encryption.encrypt(salt))
- if (encryptedPassword2.equals(passwordResult)) {
- return true;
- }
- }
- } catch (SQLException e) {
- //ignore
- e.printStackTrace();
- }
- return false;
- }
Add Comment
Please, Sign In to add comment