You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Unable to recover keys from nested ZIP archives compressed with Deflate #161
Hello,
I found that when a ZIP archive is compressed again using the Deflate method and then encrypted with ZipCrypto, it is not possible to recover the encryption keys using the original file as known plaintext.
The program shows the following error:
[23:52:20] Z reduction using 1048569 bytes of known plaintext
0.3 % (3549 / 1048569)
[23:52:20] Attack on 1 Z values at index 1045029
100.0 % (1 / 1)
[23:52:20] Could not find the keys.
However, if the compression method is changed to Store (no compression), the keys can be recovered successfully.
Is there any workaround or solution for this issue?
Thank you.
With deflate your file was compressed before encryption (ZipCrypto Deflate) so you need to provide compressed data to run a known-plaintext attack with bkcrack.
Yes, you need to provide compressed data to attack a ZipCryto Deflate entry. In general, guessing compressed data is the difficult part.
However, for high entropy files such as compressed archives, it is likely that the deflate compressor outputs stored deflate blocks. Stored deflate blocks do not actually compress data. They are made of a 5-bytes header followed by uncompressed data. See section 3.2.4 of deflate specification.
Comparing uncompressed and packed size can suggest that this is what happens.
Then, guessing compressed data is easier : it is the same as guessing uncompressed data and passing the correct offset to account for the stored block header. Assuming you guess data at the beginning of the original file, you would pass option -o 5.
But if the compressor didn't output stored blocks, guessing compressed data is harder. It requires a substantial part of the original file or at least a precise knowledge of the statistical distribution of bytes in the original file.
Activity
macgra commentedon Jul 12, 2026
With deflate your file was compressed before encryption (ZipCrypto Deflate) so you need to provide compressed data to run a known-plaintext attack with bkcrack.
Check out the tutorial:
https://github.com/kimci86/bkcrack/blob/master/example/tutorial.md
https://github.com/kimci86/bkcrack/blob/master/example/tutorial.md#the-not-so-easy-way-deflated-file
kimci86 commentedon Jul 12, 2026
Yes, you need to provide compressed data to attack a ZipCryto Deflate entry. In general, guessing compressed data is the difficult part.
However, for high entropy files such as compressed archives, it is likely that the deflate compressor outputs stored deflate blocks. Stored deflate blocks do not actually compress data. They are made of a 5-bytes header followed by uncompressed data. See section 3.2.4 of deflate specification.
Comparing uncompressed and packed size can suggest that this is what happens.
Then, guessing compressed data is easier : it is the same as guessing uncompressed data and passing the correct offset to account for the stored block header. Assuming you guess data at the beginning of the original file, you would pass option
-o 5.But if the compressor didn't output stored blocks, guessing compressed data is harder. It requires a substantial part of the original file or at least a precise knowledge of the statistical distribution of bytes in the original file.