Skip to content

Commit

Permalink
Update readme and tutorial with password length ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
kimci86 committed Sep 7, 2022
1 parent 8e3502d commit 27a9f22
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 deletions.
28 changes: 8 additions & 20 deletions example/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,12 @@ The internal keys are enough.
However, we might also be interested in finding the original password.
To do this, we need to choose a maximum length and a set of characters among which we hope to find those that constitute the password.
To save time, we have to choose those parameters wisely.
For a given maximal length, a small charset will be explored much faster than a big one, but making a wrong assumption by choosing a charset that is too small will not allow to recover the password.
For a given length, a small charset will be explored much faster than a big one, but making a wrong assumption by choosing a charset that is too small will not allow to recover the password.

At first, we can try all candidates up to a given length without making any assumption about the character set. We use the charset `?b` which is the set containing all bytes (from 0 to 255), so we do not miss any candidate up to length 9.
At first, we can try all candidates up to a given length without making any assumption about the character set.
We use the charset `?b` which is the set containing all bytes (from 0 to 255), so we do not miss any candidate up to length 9.

$ ../bkcrack -k c4490e28 b414a23d 91404b31 -r 9 ?b
$ ../bkcrack -k c4490e28 b414a23d 91404b31 --bruteforce ?b --length 0..9

[17:52:16] Recovering password
length 0-6...
Expand All @@ -131,36 +132,23 @@ At first, we can try all candidates up to a given length without making any assu

It failed so we know the password has 10 characters or more.

Now, let us assume the password is made of 11 or less printable ASCII characters, using the charset `?p`.
Now, let us assume the password is made of 10 or 11 printable ASCII characters, using the charset `?p`.

$ ../bkcrack -k c4490e28 b414a23d 91404b31 -r 11 ?p
$ ../bkcrack -k c4490e28 b414a23d 91404b31 --bruteforce ?p --length 10..11

[17:52:34] Recovering password
length 0-6...
length 7...
length 8...
length 9...
length 10...
100.0 % (9025 / 9025)
length 11...
100.0 % (9025 / 9025)
[17:52:38] Could not recover password

It failed again so we know the password has non-printable ASCII characters or has 12 or more characters.

Now, let us assume the password is made of 12 or less alpha-numerical characters.
Now, let us assume the password is made of 12 alpha-numerical characters.

$ ../bkcrack -k c4490e28 b414a23d 91404b31 -r 12 ?a
$ ../bkcrack -k c4490e28 b414a23d 91404b31 --bruteforce ?a --length 12

[17:54:37] Recovering password
length 0-6...
length 7...
length 8...
length 9...
length 10...
100.0 % (3844 / 3844)
length 11...
100.0 % (3844 / 3844)
length 12...
51.8 % (1993 / 3844)
[17:54:49] Password
Expand Down
7 changes: 6 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,15 @@ It assumes that every entry was originally encrypted with the same password.

### Recover password

Given the internal keys, bkcrack can try to find the original password up to a given length:
Given the internal keys, bkcrack can try to find the original password.
You can look for a password up to a given length using a given character set:

bkcrack -k 1ded830c 24454157 7213b8c5 -r 10 ?p

You can be more specific by specifying a minimal password length:

bkcrack -k 18f285c6 881f2169 b35d661d -r 11..13 ?p

Learn
-----

Expand Down

0 comments on commit 27a9f22

Please sign in to comment.