Add bcrypt_2y for new phpbb system
This commit is contained in:
@@ -20,7 +20,8 @@ public class PasswordSecurity {
|
||||
private static SecureRandom rnd = new SecureRandom();
|
||||
public static HashMap<String, String> userSalt = new HashMap<String, String>();
|
||||
|
||||
public static String createSalt(int length) throws NoSuchAlgorithmException {
|
||||
public static String createSalt(int length)
|
||||
throws NoSuchAlgorithmException {
|
||||
byte[] msg = new byte[40];
|
||||
rnd.nextBytes(msg);
|
||||
MessageDigest sha1 = MessageDigest.getInstance("SHA1");
|
||||
@@ -94,6 +95,10 @@ public class PasswordSecurity {
|
||||
salt = createSalt(16);
|
||||
userSalt.put(playerName, salt);
|
||||
break;
|
||||
case BCRYPT2Y:
|
||||
salt = createSalt(22);
|
||||
userSalt.put(playerName, salt);
|
||||
break;
|
||||
case MD5:
|
||||
case SHA1:
|
||||
case WHIRLPOOL:
|
||||
|
||||
Reference in New Issue
Block a user