Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to "disguise" (encrypt?) a (zip) file?

How to "disguise" (encrypt?) a (zip) file?

Scheduled Pinned Locked Moved C / C++ / MFC
game-devtutorialquestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kb
    wrote on last edited by
    #1

    Hi, I have written a file packer for a game engine. The packer uses Zip compression (based on the zlib library), and so any packed files can easily be opened with WinZip, EnZip etc. However, I would like to give them better protection. Currently they can be password protected (and the password is encrypted), so people can open the zip file but not extract any of the contents. However, I was wondering if there was any way to make the Zip file unreadable to WinZip etc and only readable to my program. Any suggestions would be much appreciated. Many thanks, KB

    T J M 3 Replies Last reply
    0
    • K kb

      Hi, I have written a file packer for a game engine. The packer uses Zip compression (based on the zlib library), and so any packed files can easily be opened with WinZip, EnZip etc. However, I would like to give them better protection. Currently they can be password protected (and the password is encrypted), so people can open the zip file but not extract any of the contents. However, I was wondering if there was any way to make the Zip file unreadable to WinZip etc and only readable to my program. Any suggestions would be much appreciated. Many thanks, KB

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      Create an unprotected .zip with dummy name containing all files and zip it again with a password. Users will be able to see one filename in protected .zip. Tomasz Sowinski -- http://www.shooltz.com

      ** Putt knot yore thrust inn spel chequers. **

      1 Reply Last reply
      0
      • K kb

        Hi, I have written a file packer for a game engine. The packer uses Zip compression (based on the zlib library), and so any packed files can easily be opened with WinZip, EnZip etc. However, I would like to give them better protection. Currently they can be password protected (and the password is encrypted), so people can open the zip file but not extract any of the contents. However, I was wondering if there was any way to make the Zip file unreadable to WinZip etc and only readable to my program. Any suggestions would be much appreciated. Many thanks, KB

        J Offline
        J Offline
        Jon Hulatt
        wrote on last edited by
        #3

        or, mangle the data as you write it to the file. very simple way would be to pick a random DWORD, and xor every 4 bytes with it. This should screw the thing up enough that winzip won't make head or tail of it. Then, as you read it, xor again with the same number to get back to where you started. STL is a religeon. Enquiries to Reverend Christian Graus

        K 1 Reply Last reply
        0
        • J Jon Hulatt

          or, mangle the data as you write it to the file. very simple way would be to pick a random DWORD, and xor every 4 bytes with it. This should screw the thing up enough that winzip won't make head or tail of it. Then, as you read it, xor again with the same number to get back to where you started. STL is a religeon. Enquiries to Reverend Christian Graus

          K Offline
          K Offline
          kb
          wrote on last edited by
          #4

          Thanks both for your replies - I think I may well try to change the way it writes, as Jon Hulatt suggests. This will obviously mean writing my own packer utility too (I was using WinZip to pack and then my own program only needed to unpack), but that shouldn't be too bad. Thanks again, KB

          J 1 Reply Last reply
          0
          • K kb

            Thanks both for your replies - I think I may well try to change the way it writes, as Jon Hulatt suggests. This will obviously mean writing my own packer utility too (I was using WinZip to pack and then my own program only needed to unpack), but that shouldn't be too bad. Thanks again, KB

            J Offline
            J Offline
            Jon Hulatt
            wrote on last edited by
            #5

            no need. pack with winzip, just write a quick program that opens your zip file and writes a new mangled one. STL is a religeon. Enquiries to Reverend Christian Graus

            1 Reply Last reply
            0
            • K kb

              Hi, I have written a file packer for a game engine. The packer uses Zip compression (based on the zlib library), and so any packed files can easily be opened with WinZip, EnZip etc. However, I would like to give them better protection. Currently they can be password protected (and the password is encrypted), so people can open the zip file but not extract any of the contents. However, I was wondering if there was any way to make the Zip file unreadable to WinZip etc and only readable to my program. Any suggestions would be much appreciated. Many thanks, KB

              M Offline
              M Offline
              Mike Nordell
              wrote on last edited by
              #6

              I added exactly this capability to zziplib some time ago.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups