0

I have an archive with an encrypted entry. When I read and save with DotnetZip I can't unencrypt the entry anymore. Looking at the raw data, the order of the extra field has changed. There are two fields, the unix timestamp and something else. I'm not sure what the other field is exactly but it seems to be important for decryption. Any idea what that field is? How can I modify the extra field with DotnetZip or tell it to use the same one?

using (ZipFile zip = new ZipFile(source))
{
    zip.Save(destination);
}

left before | right after

[EDIT]

After some more searching and testing, I figured out that the field is the Winzip AES field. The problem is not actually the order of the fields but that the vendor number gets changed from 2 to 1 by Dotnetzip. Which indicates that CRC should be checked. One solution would be to decrypt and reencrypt the file but I want to avoid that so I'll probably write the data to a stream and modify the byte manually.

TomMaier
  • 131
  • 1
  • 2
  • 9

1 Answers1

0

I fixed the problem by modifying DotnetZip to always use AE-2. This will probably cause issues when saving AE-1 files but in my case it works. I created a issue for DotnetZip, so hopefully the will add proper support of AE-2

TomMaier
  • 131
  • 1
  • 2
  • 9