Change password hash from SHA512 to SHA256.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 25 Jul 2012 19:05:36 +0000 (21:05 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 26 Jul 2012 05:28:48 +0000 (07:28 +0200)
src/main/java/net/pterodactylus/demoscenemusic/data/DefaultUser.java

index 6867ef3..fb2836c 100644 (file)
@@ -64,7 +64,7 @@ public class DefaultUser extends DefaultBase implements User {
        @Override
        public User setPassword(String password) {
                try {
-                       getValue("password", String.class).set(Hex.toHex(MessageDigestHasher.getSHA512Hasher().hash(password.getBytes("UTF-8"))));
+                       getValue("password", String.class).set(Hex.toHex(MessageDigestHasher.getSHA256Hasher().hash(password.getBytes("UTF-8"))));
                        return this;
                } catch (UnsupportedEncodingException uee1) {
                        throw new RuntimeException("VM does not support UTF-8.", uee1);
@@ -86,7 +86,7 @@ public class DefaultUser extends DefaultBase implements User {
        @Override
        public boolean verifyPassword(String password) {
                try {
-                       return getValue("password", String.class).get().equalsIgnoreCase(Hex.toHex(MessageDigestHasher.getSHA512Hasher().hash(password.getBytes("UTF-8"))));
+                       return getValue("password", String.class).get().equalsIgnoreCase(Hex.toHex(MessageDigestHasher.getSHA256Hasher().hash(password.getBytes("UTF-8"))));
                } catch (UnsupportedEncodingException uee1) {
                        throw new RuntimeException("VM does not support UTF-8.", uee1);
                }