I am using a library to password protect my files into a zip file. The implementation has been taken from this piece of code.
I want to understand which algorithm(if any) has been used here to password protect the files.
The code is minimal and easily readable.
Any leads on this would be helpful.
1 Answer
This is Traditional PKWARE Encryption as documented in the PKWARE ZIP specification (see Section 6.0). It's an old stream cipher which suffers from a known-plaintext attack (see Biham and Stay publications) and has been replaced with AES in newer ZIP archive utilities.
See a lengthy answer here regarding the possibility of ZIP file password recovery when this cipher is in use.
Various people have implemented the known-plaintext attack and code is available (pkcrack and bkcrack).
-
$\begingroup$ Thank you for the quick reply. As I understand, PKWARE is an organization. So which algorithm do they use? Or PKWARE is an encryption standard. $\endgroup$ Commented Jul 6, 2018 at 8:54
-
$\begingroup$ It is a proprietary encryption algorithm developed by PKWARE. The algorithm is described in the specification. $\endgroup$– conchildCommented Jul 6, 2018 at 8:59