Hi,
Thementitel vielleicht etwas mau…
Also es geht um folgendes, KeePass, und „Passwortstärke“. Ich trau’ der Sache noch nicht voll (wie angeblich sicher ein Passwort sei).
Angenommen, das Präfix sei bekannt, und man möchte nur den letzten Buchstaben ermitteln:
public static void main(String[] args) throws FileNotFoundException {
File kfile = new File("bestimmter.key");
File dfile = new File("bestimmter.kdbx");
long sta = System.currentTimeMillis();
for (char i = 'a'; i <= 'z'; i++) {
try {
KdbxCreds kdbxCreds = new KdbxCreds(("praefix" + i).getBytes(), new FileInputStream(kfile));
SimpleDatabase load = SimpleDatabase.load(kdbxCreds, new FileInputStream(dfile));
load.visit(new Visitor.Print());
System.out.println("i = " + i);
break;
} catch (Exception exception) {
System.out.println("exception = " + exception);
}
}
long sto = System.currentTimeMillis();
System.out.println(sto - sta);
}
Das erstellt diese wunderbare Ausgabe:
Zusammenfassung
exception = java.lang.IllegalStateException: Inconsistent stream start bytes. This usually means the credentials were wrong.
exception = java.lang.IllegalStateException: Inconsistent stream start bytes. This usually means the credentials were wrong.
exception = java.lang.IllegalStateException: Inconsistent stream start bytes. This usually means the credentials were wrong.
exception = java.lang.IllegalStateException: Inconsistent stream start bytes. This usually means the credentials were wrong.
/NewDatabase/
/NewDatabase/Sample Entry
/NewDatabase/Sample Entry #2
/NewDatabase/General/
/NewDatabase/Windows/
/NewDatabase/Windows/Bla1
/NewDatabase/Network/
/NewDatabase/Internet/
/NewDatabase/eMail/
/NewDatabase/Homebanking/
i = e
20125
Jetzt zu meinen Fragen:
- Wieso dauert das so ewig (5 Sekunden pro Versuch)?
- Wo ist der bottle neck?
- Wie könnte man das um (alle) Kollisionen zu bestimmen besser machen?
Freue mich auf Antworten.