Minor - favor Guava's UTF-8 charset constant; sensible -> sensitive in issue template
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
package fr.xephi.authme.security.crypts;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import fr.xephi.authme.security.HashUtils;
|
||||
import fr.xephi.authme.security.MessageDigestAlgorithm;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
||||
public class CRAZYCRYPT1 extends UsernameSaltMethod {
|
||||
|
||||
private static final char[] CRYPTCHARS =
|
||||
{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
||||
private final Charset charset = Charset.forName("UTF-8");
|
||||
|
||||
private static String byteArrayToHexString(final byte... args) {
|
||||
final char[] chars = new char[args.length * 2];
|
||||
@@ -24,7 +24,7 @@ public class CRAZYCRYPT1 extends UsernameSaltMethod {
|
||||
public HashedPassword computeHash(String password, String name) {
|
||||
final String text = "ÜÄaeut//&/=I " + password + "7421€547" + name + "__+IÄIH§%NK " + password;
|
||||
final MessageDigest md = HashUtils.getDigest(MessageDigestAlgorithm.SHA512);
|
||||
md.update(text.getBytes(charset), 0, text.length());
|
||||
md.update(text.getBytes(Charsets.UTF_8), 0, text.length());
|
||||
return new HashedPassword(byteArrayToHexString(md.digest()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user