From 4d23600d22ae424e3d423e1a1deb96249fd6a561 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 25 Jul 2012 21:05:36 +0200 Subject: [PATCH] Change password hash from SHA512 to SHA256. --- src/main/java/net/pterodactylus/demoscenemusic/data/DefaultUser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } -- 2.7.4