-
I'm getting a "The parameter is incorrect" exception when I try to use a password of 100 characters or more (I'm creating a .zip file using AES256 encryption). Do zip files have a 99 character limit? I'm not finding any information about that. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi! I did a quick search in the 7-zip source code, and indeed, it doesn't allow passwords longer than 99 characters when using AES encryption (https://github.com/rikyoz/7-Zip/blob/df1b8d60abd8246f3cf56c275b0f88ea6d14c4da/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp#L421 https://github.com/rikyoz/7-Zip/blob/df1b8d60abd8246f3cf56c275b0f88ea6d14c4da/CPP/7zip/Crypto/WzAes.h#L38). I did some tests using WinRar, too, and it managed to create AES256-encrypted Zip files with passwords longer than 99 characters without issues, so it seems more a limitation of 7-zip, not of the Zip format itself. |
Beta Was this translation helpful? Give feedback.
Hi!
Yeah, it seems to be a limitation of 7-zip, even in the GUI program:
I did a quick search in the 7-zip source code, and indeed, it doesn't allow passwords longer than 99 characters when using AES encryption (https://github.com/rikyoz/7-Zip/blob/df1b8d60abd8246f3cf56c275b0f88ea6d14c4da/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp#L421 https://github.com/rikyoz/7-Zip/blob/df1b8d60abd8246f3cf56c275b0f88ea6d14c4da/CPP/7zip/Crypto/WzAes.h#L38).
Using ZipCrypto, 7-zip doesn't impose the same limit.
I did some tests using WinRar, too, and it managed to create AES256-encrypted Zip files with passwords longer than 99 characters without issues, so it seems more a limitation of 7-zip, not of the Zip …