[Minor] looping in PasswordCreator

This commit is contained in:
Robert von Burg 2017-05-25 22:19:08 +02:00
parent b8452dc6e4
commit 3905a38a32
1 changed files with 73 additions and 69 deletions

View File

@ -43,6 +43,8 @@ public class PasswordCreator {
@SuppressWarnings("nls") @SuppressWarnings("nls")
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
while (true) {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String hashAlgorithm = null; String hashAlgorithm = null;
@ -66,11 +68,11 @@ public class PasswordCreator {
int iterations = -1; int iterations = -1;
while (iterations == -1) { while (iterations == -1) {
System.out.print("Hash iterations [200000]: "); System.out.print("Hash iterations [10000]: ");
String readLine = r.readLine().trim(); String readLine = r.readLine().trim();
if (readLine.isEmpty()) { if (readLine.isEmpty()) {
iterations = 200000; iterations = 10000;
} else { } else {
try { try {
@ -126,7 +128,9 @@ public class PasswordCreator {
System.out.println("Salt is: " + saltS); System.out.println("Salt is: " + saltS);
System.out.println(); System.out.println();
System.out.println(XmlConstants.XML_ATTR_PASSWORD + "=\"" + passwordHashS + "\" " + XmlConstants.XML_ATTR_SALT System.out.println(XmlConstants.XML_ATTR_PASSWORD + "=\"" + passwordHashS + "\" "
+ "=\"" + saltS + "\""); + XmlConstants.XML_ATTR_SALT + "=\"" + saltS + "\"");
System.out.println();
}
} }
} }