[
  {
    "Id": "441359",
    "ThreadId": "212227",
    "Html": "I would like to try to make the ZIP openable only by my software. In other words I don't want it opened in winzip, winrar, etc. I also don't want it easily repaired. Do I need to modify the source code? I plan on integrating the source code into my project so I have one less file to distribute. I haven't looked into the code yet. I'm using C#.\r\n\r\nThanks! And good job :)",
    "PostedDate": "2010-05-11T01:21:54.57-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "441405",
    "ThreadId": "212227",
    "Html": "<p>DotNetZip makes zip files.</p>\r\n<p>If you want it to make something other than a zipfile, then you have some options:</p>\r\n<ul>\r\n<li>encrypt it, after producing the archive.&nbsp; </li>\r\n<li>simply scramble it - as with a ROT13 transform</li>\r\n<li>add some rubbish data bytes to the front of it - this is more of a &quot;data hiding&quot; approach.</li>\r\n<li>Don't use DotNetZip</li>\r\n</ul>\r\n<p>Based on your brief statement of requirements, I don't think it would make sense, for your purposes, to modify DotNetZip.</p>\r\n<p>There is no way to make any file &quot;only openable&quot; by your software.&nbsp; All software can be reverse-engineered.&nbsp; Especially if you use .NET.&nbsp; The best you can hope for is to make it <em>difficult</em> to open a file by other software.&nbsp; Making a file &quot;not openable by winzip&quot; is easy, using any of the methods I described above.&nbsp; Making a file &quot;not openable by a determined hacker&quot; is impossible.</p>\r\n<p>As for integrating the source code into your project, in order to avoid the need to distribute a file - I recommend against that, too.&nbsp; <a href=\"http://stackoverflow.com/questions/222655/embedding-assemblies-inside-another-assembly/625115#625115\">There are better options</a>.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-05-11T03:47:08.183-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "442876",
    "ThreadId": "212227",
    "Html": "<p>Thanks for your response, Cheeso.</p>\r\n<p>I was thinking about adding a few rubbish bytes to the front of it, just some basic padding. I don't need to &quot;secure it&quot; I just don't want it opened up by common ZIP tools.</p>\r\n<p>Basically, it stores several files used by my program (I would love to explain but NDA :() . I use serialization to write to a memorystream, then save it into the ZIP file. It's not a big deal if they CAN open it in ZIP, but it would be nice to be able to disable that part..</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-05-14T05:48:37.03-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "442906",
    "ThreadId": "212227",
    "Html": "<p>One way to render it opaque is to compress the zip file itself with DeflateStream or ZlibStream.&nbsp;&nbsp; Neither of those have clear markers and the bytes will appear to be random to the casual observer.&nbsp; To unpack you'd need to first decompress with DeflateStream or ZlibStream, then read in the zip file.</p>\r\n<p>if you merely add a few padding bytes, the zip signatures will still be visible. The offsets will be &quot;wrong&quot;, so the file won't be readable as-is, by normal zip tools, but a zip-fix tool would have no problem removing the padding and getting the proper offsets.&nbsp; Compressing or otherwise transforming the data would obscure the zip signatures.&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-05-14T07:02:24.06-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "443172",
    "ThreadId": "212227",
    "Html": "<p>If you just pad some bytes in front it, someone might be able to see PK byte in front of the file (using hex viewer or so). The best way I think is to encrypt it, my blog http://www.innosia.com explains how to use windows cryptography (CryptoAPI), you can try it and let me know.</p>",
    "PostedDate": "2010-05-14T23:50:02.423-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]