This commit is contained in:
Xephi59
2015-07-20 02:41:14 +02:00
parent 663c4a48d1
commit 480db6816f
22 changed files with 98 additions and 129 deletions
@@ -14,7 +14,6 @@
package fr.xephi.authme.security.crypts;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
@@ -141,7 +140,7 @@ public class BCRYPT implements EncryptionMethod {
* @return the decoded value of x
*/
private static byte char64(char x) {
if ((int) x < 0 || (int) x > index_64.length)
if ((int) x > index_64.length)
return -1;
return index_64[(int) x];
}
@@ -14,7 +14,7 @@ public class CryptPBKDF2 implements EncryptionMethod {
PBKDF2Parameters params = new PBKDF2Parameters("HmacSHA256", "ASCII", salt.getBytes(), 10000);
PBKDF2Engine engine = new PBKDF2Engine(params);
return result + engine.deriveKey(password, 64).toString();
return result + String.valueOf(engine.deriveKey(password, 64));
}
@Override