0

I am using DotNetZip to archive files inside a zip file, using a password.

The password I use has 144 random characters.

using (var zip = new ZipFile())
{
    zip.Password = "144 characters password";
    zip.Encryption = EncryptionAlgorithm.WinZipAes256;
    zip.CompressionLevel = Ionic.Zlib.CompressionLevel.BestSpeed;

    zip.AddEntry("file1.xml", data);

    zip.Save(file);
}

When I open the zip file from code behind (specifying the password), I can get the files inside.

If I open the archive using WinRar and set the password there, it tells me that the password is invalid.

What can be the reason for this issue? Can it be because the password length is too big?

John Willemse
  • 6,608
  • 7
  • 31
  • 45
Catalin
  • 11,503
  • 19
  • 74
  • 147
  • Maybe it has to do with encoding? Have you tried forcing the same encoding your OS is using? – Geeky Guy May 15 '13 at 12:54
  • 1
    They are only numbers in the string, so i don't think it's this issue. Anyway, i've read on [WinRar](http://www.winrar-tr.com/winrar/Help/ENG/html/HELPArcEncryption.htm) that they support maximum 127 characters – Catalin May 15 '13 at 13:00
  • Nice to know that. Out of curiosity, though, why do you need a password that big? Are you trying to challenge Douglas Adam's Deep Thought? – Geeky Guy May 15 '13 at 13:02
  • I store sensitive data and it's important that nobody can open the files. Also, the password is generated by a tool which i already used in inside the project – Catalin May 15 '13 at 13:04

1 Answers1

3

You're out of luck. According to their Web site, WinRAR only supports AES-128 and not AES-256.

WinRAR offers you the benefit of industry strength archive encryption using AES (Advanced Encryption Standard) with a key of 128 bits.

Update: Apparently, WinRAR 5.0 beta supports AES-256.

Dirk Vollmar
  • 172,527
  • 53
  • 255
  • 316
  • No, I'm afraid that the password length is too big. They have a maximum 127 characters password. [link](http://www.winrar-tr.com/winrar/Help/ENG/html/HELPArcEncryption.htm) – Catalin May 15 '13 at 12:59
  • @RaraituL: It certainly may be both, though the link you gave talks about a limitation of *.rar* files (and not .zip files). – Dirk Vollmar May 15 '13 at 13:10