0

I'm using Minizip to work with some zip files, and would like to be able to check if a zip file contains encrypted/password protected files. If I call unzGetCurrentFileInfo, and look at the resulting unz_file_info structure, I've noticed that the external_fa field seems to be 0 for non encrypted files, and 0x20 for encrypted ones.

However, this is just what I've observed from debugging and as I can't find anything in the Minizip code documenting what different values in this field actually mean, I'm wary of making assumptions.

Anyone know any more?

Tom Davies
  • 2,386
  • 3
  • 27
  • 44
  • `external_fa` should be unrelated but the general-purpose flag value 32 should be set. – Konrad Rudolph Apr 02 '19 at 10:07
  • are you using c or c++? Also you say you are using Minzip but tagged zlib, which is it? – 463035818_is_not_an_ai Apr 02 '19 at 10:08
  • See [ZIP File Format Specification](https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT). Encryption was added at version 5.2 (but it was flawed). A file in the archive is encrypted if the *"encryption header"* is present. The encryption header SHOULD be placed after the *"local header"*. – jww Apr 02 '19 at 10:16
  • 2
    General purpose flag bit 0 is set for encrypted files. Both bits 6 and 0 are set if "strong encryption" is used. – Ian Abbott Apr 02 '19 at 10:16
  • Minizip is not available as a tag in SO, but as it is built on top of zlib, I tagged that. I'm working in C++, but as minizip and zlib are C, I tagged both. – Tom Davies Apr 02 '19 at 10:31

0 Answers0