{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "not reproducible",
    "ClosedDate": "2009-05-08T09:18:44.237-07:00",
    "CommentCount": 0,
    "Custom": null,
    "Description": "Hi, \n  when i m using simple this works fine but when i assign paasword  for the particaular file its created problem to read.\n  at the time of read i am getting this error message which is given below:\n \nYou cannot change the encryption method on encrypted entries read from archives.\n \nDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. \n \nException Details: System.InvalidOperationException: You cannot change the encryption method on encrypted entries read from archives.\n \nSource Error: \n \n Line 82:             using (ZipFile zip = ZipFile.Read(abFileContent))Line 83:             {Line 84:                 \n \nusing Ionic.Zip;\n \n byte[] abFileContent = new Byte[fileUpload1.PostedFile.ContentLength];\n fileUpload1.PostedFile.InputStream.Read(abFileContent, 0, fileUpload1.PostedFile.ContentLength);\n \n using (ZipFile zip = ZipFile.Read(abFileContent))\n            {\n                bool IsfileExists = false;\n                foreach (ZipEntry zipe in zip.Entries)\n                {\n                    if (zipe.FileName.Equals(string.Format(\"{0}.xml\", XMLFileName)))\n                    {\n                        IsfileExists = true;\n                        if (!string.IsNullOrEmpty(password))\n                            zipe.ExtractWithPassword(m_FilePath, password);\n                        else\n                            zipe.Extract(m_FilePath, true);\n                       \n                        break;\n                    }\n                }\n                if (!IsfileExists)\n                {\n                    throw new FileNotFoundException(string.Format(\"{0}.xml file not found in source zip file\", XMLFileName));\n                }\n            }\n \n \nThe code of ziping file with password\n \nusing Ionic.Zip;\n \nSystem.Web.HttpContext.Current.Response.Clear();\n \n            System.Web.HttpContext c = System.Web.HttpContext.Current;\n            String ReadmeText = String.Format(obj.ReadmeContents, Environment.NewLine,\n                                             System.DateTime.Now.ToString(\"G\")                                             \n                                             );\n            string zipfileName = \"abc.zip\";\n            System.Web.HttpContext.Current.Response.ContentType = \"application/zip\";\n            System.Web.HttpContext.Current.Response.AddHeader(\"content-disposition\", \"filename=\" + zipfileName);\n         using (Stream str = new MemoryStream())\n            {\n                using (ZipFile zip = new ZipFile())\n                {\n                   ZipEntry e = zip.AddFileStream(string.Format(\"{0}.xml\", XmlFileName), \"\", str);\n                   if (!string.IsNullOrEmpty(obj.ZipPassword))\n                   {\n                       e.Encryption = EncryptionAlgorithm.WinZipAes128;\n                       e.Password = ZipPassword;\n                   }\n                    zip.AddFileFromString(string.Format(\"{0}.txt\", ReadmeFileName), \"\", ReadmeText);\n                    zip.Comment = string.Format(\"{0}\", ZipFileComment);\n                    zip.Save(System.Web.HttpContext.Current.Response.OutputStream);\n                }\n            }\n\t}",
    "LastUpdatedDate": "2013-05-16T05:32:26.517-07:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2009-04-24T23:36:32.987-07:00",
    "Status": {
      "Name": "Closed",
      "Id": 4
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "Unable to open or Read .zip file from ASP.NET that includes password protected file",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 1,
    "Id": 7684
  },
  "FileAttachments": [],
  "Comments": [
    {
      "Message": "I could not duplicate this problem.  The problem you were seeing could be due to the problem described in 7696, or it could be a result of application error, or it could be a new problem completely.   I have fixed workitem 7696, and would like you to test with either v1.8.2.9 or v1.7.2.14 .  If the problem still occurs, then I will need an ASPX page that reproduces the problem.  \r\n\r\nThe exception \"You cannot change the encryption method on encrypted entries read from archives.\" is intended to indicate that your application is attempting to change the EncryptionAlgorithm on an entry that was read in from a file.  This isn't supported. If you just set the Password in order to extract an entry, you should never get this exception.   If you are getting the exception when trying to extract, it would be a bug.  But I could not reproduce it. \r\n\r\nPlease test further and let me know. \r\n\r\n\r\n",
      "PostedDate": "2009-04-30T14:41:49.23-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2009-05-08T09:18:44.237-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-21T18:44:23.547-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-05-16T05:32:26.517-07:00",
      "Id": -2147483648
    }
  ]
}