[
  {
    "Id": "1206144",
    "ThreadId": "531094",
    "Html": "Hi,<br />\nWhen I use the below code zip file is created but when I unzip it from F drive in unzipped without asking password and also without  any encryption.<br />\nI restore that database and I was successful in restoring it.<br />\n<br />\nI added dotnetzip library from nuget after installing it names as Ionic.Zip and its version is 1.9.2.0 and Runtime version is v2.0.50727<br />\n<br />\nMy project is empty asp.net application in VS 2013 and my operating system is windows 8<br />\n<br />\nWhat I am doing wrong.<br />\n<br />\nUsed code from this URL <a href=\"http://dotnetzip.codeplex.com/wikipage?title=CS-Examples\" rel=\"nofollow\">http://dotnetzip.codeplex.com/wikipage?title=CS-Examples</a><br />\nCreate a Zip archive that uses WinZip-compatible AES encryption. <br />\n<br />\nMy code is this<br />\nusing Ionic.Zip;<br />\nusing Ionic;<br />\n<br />\nusing (ZipFile zip = new ZipFile())<br />\n<pre><code>        {\n            zip.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression;\n            zip.AddFile(@&quot;F:\\\\TestDotnetzip.bak&quot;); \n            zip.Password = &quot;123456&quot;;\n            zip.Encryption = EncryptionAlgorithm.WinZipAes256;\n            zip.Save(@&quot;F:\\\\TestDotnetzip.zip&quot;);\n        }</code></pre>\n\n",
    "PostedDate": "2014-02-09T22:53:55.06-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "1245718",
    "ThreadId": "531094",
    "Html": "Did you found the solution ? I am facing the same problem.<br />\n",
    "PostedDate": "2014-05-15T06:25:42.967-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "1245963",
    "ThreadId": "531094",
    "Html": "ya \r<br />\n<br />\nwrite code like this for password protection\r<br />\n<br />\nusing (ZipFile zip = new ZipFile())\r<br />\n{<br />\n<pre><code>        zip.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression;\n        zip.AddFile(@&quot;F:\\\\TestDotnetzip.bak&quot;).Password = &quot;123456&quot;;\n        zip.Encryption = EncryptionAlgorithm.WinZipAes256;\n        zip.Save(@&quot;F:\\\\TestDotnetzip.zip&quot;);</code></pre>\n\n}\r<br />\n<br />\nthis will work<br />\n",
    "PostedDate": "2014-05-15T18:47:34.31-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "1245964",
    "ThreadId": "531094",
    "Html": "ya \r<br />\n<br />\nwrite code like this for password protection \r<br />\n<br />\nusing (ZipFile zip = new ZipFile()) \r<br />\n{<br />\n<pre><code>    zip.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression;\n    zip.AddFile(@&quot;F:\\\\TestDotnetzip.bak&quot;).Password = &quot;123456&quot;;\n    zip.Encryption = EncryptionAlgorithm.WinZipAes256;\n    zip.Save(@&quot;F:\\\\TestDotnetzip.zip&quot;);</code></pre>\n\n} \r<br />\n<br />\nthis will work<br />\n",
    "PostedDate": "2014-05-15T18:47:47.39-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "1254340",
    "ThreadId": "531094",
    "Html": "Incase someone need to add multiple files with password and not saving the original directory on the zipfile.<br />\n<pre><code>using (Ionic.Zip.ZipFile zip1 = new Ionic.Zip.ZipFile(zipFileName))\n            {\n                zip1.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression;\n                zip1.Password = &quot;abc12345&quot;;\n                zip1.AddFiles(filenames ,false,&quot;&quot;);\n                zip1.Encryption = Ionic.Zip.EncryptionAlgorithm.WinZipAes256;\n                zip1.Save();\n                \n            }</code></pre>\n\n",
    "PostedDate": "2014-06-09T03:53:44.313-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]