[BugFix] print out correct salt

This commit is contained in:
Reto Breitenmoser 2018-03-18 15:44:33 +01:00
parent 6d7e473564
commit 208ecb6cd8
1 changed files with 4 additions and 5 deletions

View File

@ -120,12 +120,11 @@ public class PasswordCreator {
System.out.print("Password: ");
char[] password = r.readLine().trim().toCharArray();
System.out.print("Salt [random]: ");
String saltTemp = r.readLine().trim();
if (saltTemp.isEmpty()) {
saltTemp = encryptionHandler.nextToken();
String saltS = r.readLine().trim();
if (saltS.isEmpty()) {
saltS = encryptionHandler.nextToken();
}
String saltS = StringHelper.toHexString(saltTemp.getBytes());
byte[] salt = StringHelper.fromHexString(saltS);
byte[] salt = saltS.getBytes();
byte[] passwordHash = encryptionHandler.hashPassword(password, salt);
String passwordHashS = StringHelper.toHexString(passwordHash);