From: David ‘Bombe’ Roden Date: Wed, 25 Jul 2012 19:05:36 +0000 (+0200) Subject: Change password hash from SHA512 to SHA256. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4d23600d22ae424e3d423e1a1deb96249fd6a561;p=demoscenemusic.git Change password hash from SHA512 to SHA256. --- diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultUser.java b/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultUser.java index 6867ef3..fb2836c 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultUser.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultUser.java @@ -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); }