[
  {
    "Id": "216899",
    "ThreadId": "63785",
    "Html": "<p>Hi,</p>\r\n<p>first of all I have to say that this library is really great.</p>\r\n<p>I came across a little bug, since i am dealing a lot with encrypted zip files i am usually walking on the edge. I realized that the usage of UpdateFileStream function on an encrypted file is not resulting in an winrar compatible format. I came across a similar issue earlier during the usage of a different library which was not updating the header data of other entries in the zip by running any update method. But for encrypted files this seems to lead to a non zip compatible format. So i thought that might be the same issue here.</p>\r\n<p>I would be very happy if someone could look into that.</p>\r\n<p>Regards,</p>\r\n<p>AirBorne</p>",
    "PostedDate": "2009-07-28T11:00:57.62-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "216909",
    "ThreadId": "63785",
    "Html": "<p>can you give me some code or pseudo code to show what does not work, and how it does not work?</p>\r\n<p>for example, you create a zip file, then update a single entry in the zip file, then save, and then... what happens? eg I want to see this from you:</p>\r\n<pre>  // create the zip file\r\n  using (var zip = new ZipFile())\r\n  {\r\n    zip.Encryption = EncryptionAlgorithm.WinZipAES256; \r\n    zip.Password = &quot;password1&quot;;\r\n    zip.AddEntry(&quot;Readme.txt&quot;, &quot;&quot;, &quot;This is the content.&quot;);\r\n    zip.Save(&quot;archive.zip&quot;);\r\n  }\r\n  // evverything works fine, the zip file is valid.\r\n\r\n  // then I try to update the zip file\r\n  using (var zip = ZipFile.Read(&quot;archive.zip&quot;))\r\n  {\r\n    // set the password here?\r\n    \r\n    zip.UpdateFileStream(???);  // what arguments here? \r\n    zip.Save();\r\n  }\r\n  // the resulting zip is unreadable\r\n</pre>",
    "PostedDate": "2009-07-28T11:15:29.913-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "216910",
    "ThreadId": "63785",
    "Html": "<p>also, what version of the library are you using ?</p>",
    "PostedDate": "2009-07-28T11:16:59.537-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "216922",
    "ThreadId": "63785",
    "Html": "<table border=0 width=800>\r\n<tbody>\r\n<tr>\r\n<td>\r\n<p>I just ran this on v1.8.4.12</p>\r\n<pre>            string zipFileToCreate = &quot;Airborne.zip&quot;;\r\n            // Step 1. create the zip file\r\n            using (var zip = new ZipFile())\r\n            {\r\n                zip.Encryption = EncryptionAlgorithm.WinZipAes256;\r\n                zip.Password = &quot;password1&quot;;\r\n                zip.AddEntry(&quot;Readme.txt&quot;, &quot;&quot;, &quot;This is the content.&quot;);\r\n                zip.Save(zipFileToCreate);\r\n            }\r\n            // everything works fine, the zip file is valid.\r\n\r\n            // Step 2. then update the zip file\r\n            using (MemoryStream ms = StringToMemoryStream(&quot;This is the new content.\\r\\n&quot;))\r\n            {\r\n                using (var zip = ZipFile.Read(zipFileToCreate))\r\n                {\r\n                    zip.UpdateEntry(&quot;Readme.txt&quot;, &quot;&quot;, ms);\r\n                    zip.Save();\r\n                }\r\n            }\r\n            // everything works fine, the zip file is still valid.\r\n</pre>\r\n<p>The zip file produced at the end of Step 2 contains a single entry with updated content. The encryption on that entry is &quot;None&quot;. This is because I did not set an encryption or password to use on that entry or zip file.</p>\r\n<p>I also tried updating a zip file with mutiple entries, and encryption, like so:</p>\r\n<pre>            // Step 1. create the zip file\r\n            using (var zip = new ZipFile())\r\n            {\r\n                zip.Encryption = EncryptionAlgorithm.WinZipAes256;\r\n                zip.Password = &quot;password1&quot;;\r\n                zip.AddEntry(&quot;Readme.txt&quot;, &quot;&quot;, &quot;This is the original content.&quot;);\r\n                zip.AddEntry(&quot;MoreText.txt&quot;, &quot;&quot;, &quot;Sometimes at night I lay awake thinking about {e077a805-f3fa-4868-a34f-5f78abc3e836}, and it is really starting to bother me....&quot;);\r\n                zip.Save(zipFileToCreate);\r\n            }\r\n            // everything works fine, the zip file is valid.\r\n\r\n            // Step 2. update the zip file\r\n            using (MemoryStream ms = StringToMemoryStream(&quot;This is the new content for the readme.  It will replace the original content.\\r\\n&quot;))\r\n            {\r\n                using (var zip = ZipFile.Read(zipFileToCreate))\r\n                {\r\n                    zip.Password = &quot;password1&quot;;\r\n                    zip.Encryption = EncryptionAlgorithm.WinZipAes256;\r\n                    zip.UpdateEntry(&quot;Readme.txt&quot;, &quot;&quot;, ms);\r\n                    zip.Save();\r\n                }\r\n            }\r\n            // everything works fine, the zip file is still valid.\r\n</pre>\r\n<p>This also works, no problems in the output zip file. In this case though, both entries in the output zip file are encrypted with AES256.&nbsp; I also modified step 2, to NOT specify a password or encryption, and that also works.&nbsp; In that case, the unmodified entry retains the AES encryption, while the updated entry is unencrypted.&nbsp;&nbsp;</p>\r\n<p>If you can give me some code like this showing what you do to cause the problem, I'll be able to look into it better.&nbsp;</p>\r\n<p>Also I suggest you use the latest version of the library when building that test case.</p>\r\n<p>&nbsp;</p>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>",
    "PostedDate": "2009-07-28T11:44:19.167-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "216930",
    "ThreadId": "63785",
    "Html": "<p>ps: note that UpdateFileStream() is now marked &quot;obsolete&quot;.&nbsp; Effectively, there's a new name for the method:&nbsp; UpdateEntry().&nbsp; It accepts the same arguments.</p>",
    "PostedDate": "2009-07-28T12:28:02.157-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "216946",
    "ThreadId": "63785",
    "Html": "<p>Hi Cheeso,</p>\r\n<p>thank you for the very prompt reply. The problem does not seem to be present in the latest version.<br>Sorry for bothering you with that, I thought I was using the latest version but obviously I was not. I will<br>let you know in case I am running across any other observations.</p>\r\n<p>Thank you again, the lib is really great and is even getting better ;)</p>\r\n<p>Best Regards,<br>AirBorne</p>",
    "PostedDate": "2009-07-28T13:27:17.937-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "217026",
    "ThreadId": "63785",
    "Html": "<p>Terrific.&nbsp; Glad it's working out for you.</p>",
    "PostedDate": "2009-07-28T19:14:14.087-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]