Skip to content

Commit

Permalink
Update readme and tutorial with -D option
Browse files Browse the repository at this point in the history
  • Loading branch information
kimci86 committed May 13, 2024
1 parent 1300256 commit c4633d2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
14 changes: 11 additions & 3 deletions example/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,22 @@ After a little while, the keys will appear!

Once we have the keys, we can recover the original files.

## Choose a new password
## Remove the password

We assume that the same keys were used for all the files in the zip file.
We can create a new encrypted archive based on `secret.zip`, but with a new password, `easy` in this example.
We can create a new archive based on `secrets.zip`, but without password protection.

$ ../bkcrack -C secrets.zip -k c4490e28 b414a23d 91404b31 -D secrets_without_password.zip

Then, any zip file utility can extract the created archive.

## Choose a new password

We can also create a new encrypted archive, but with a new password, `easy` in this example.

$ ../bkcrack -C secrets.zip -k c4490e28 b414a23d 91404b31 -U secrets_with_new_password.zip easy

Then, any zip file utility can extract the created archive. You will just have to type the chosen password when prompted.
Then, you will just have to type the chosen password when prompted to extract the created archive.

## Or decipher files

Expand Down
23 changes: 18 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ It can also be used to bruteforce the password with a complexity of *n<sup>l-6</
The main features are:

- Recover internal state from ciphertext and plaintext.
- Change a ZIP archive's password using the internal state.
- Remove or change a ZIP archive's password using the internal state.
- Recover the original password from the internal state.

Install
Expand Down Expand Up @@ -120,14 +120,27 @@ If deflate compression was used, a Python 3 script provided in the `tools` folde

python3 tools/inflate.py < decipheredfile > decompressedfile

### Unlock encrypted archive
### Remove password

To get access to all the entries of the encrypted archive in a single step, you can generate a new archive with the same content but without encryption.
It assumes that every entry was originally encrypted with the same password.

bkcrack -C encrypted.zip -k 12345678 23456789 34567890 -D decrypted.zip

### Change password

It is also possible to generate a new encrypted archive with the password of your choice:

bkcrack -C encrypted.zip -k 12345678 23456789 34567890 -U unlocked.zip password
bkcrack -C encrypted.zip -k 12345678 23456789 34567890 -U unlocked.zip new_password

The archive generated this way can be extracted using any zip file utility with the new password.
It assumes that every entry was originally encrypted with the same password.
You can also define the new password by its corresponding internal representation.

bkcrack -C encrypted.zip -k 12345678 23456789 34567890 --change-keys unlocked.zip 581da44e 8e40167f 50c009a0

Those two commands can be used together to change the contents of an encrypted archive without knowing the password but knowing only the internal keys:
you can make a copy encrypted with the password of you choice,
then edit the copy with an archive manager entering the chosen password when prompted,
and finally make a copy of the modified archive back with the original encryption keys.

### Recover password

Expand Down

0 comments on commit c4633d2

Please sign in to comment.