Encryption and MemoryStream

Aug 13, 2009 at 10:48 PM

I'm trying to create Encrypted in Memory ZIP which can be attached to E-mail, but it seems to be not working properly for me. Please let me know what's wrong with my code.  Setting Encryption and Password at ZipFile dosen’t work either.

MemoryStream mstrm = new MemoryStream();
using(ZipFile zip = new ZipFile())
ZipEntry entry = zip.AddEntry("test.txt", "", "HelloWorld");
entry.Password = "hello";
entry.Encryption = EncryptionAlgorithm.WinZipAes256;

It saves fine and can be opened using WinZip but when try to extract file it fails with invalid password.

Aug 13, 2009 at 10:50 PM

what you are trying to do, should work. what version of the library are you using?

Aug 13, 2009 at 10:55 PM

I'm using latest stable release ''.

Aug 13, 2009 at 11:18 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Aug 14, 2009 at 3:13 AM

Thanks for reporting the problem.  I believe this is fixed in v1.8.4.18, which you can download now.


Aug 14, 2009 at 5:22 AM

Downloaded latest version and it’s working like champ. Thanks for quick response.