Create a Password Protected ZIP

By  on  

Have you ever wanted to put very basic security (a passphrase) on a file?  You can do so if you ZIP the file -- let's have a look at how you can password-protect a ZIP file!

Creating a password protected ZIP file from command line is done so via the following command:

# zip -er {file name to be created} {source directory or file}
zip -er my-generated-file.zip source-file.rtf

When someone tries to unzip the file, they'll be prompted for a password.

Don't be under any illusion that a password makes the ZIP file too secure:  ZIP files don't self-destruct after a given number of attempts so a brute force effort to crack the password would ultimately be effective.  If you do, however, want a very basic level of security for the contents of a file, this command will get you there.

Recent Features

  • By
    Create Namespaced Classes with MooTools

    MooTools has always gotten a bit of grief for not inherently using and standardizing namespaced-based JavaScript classes like the Dojo Toolkit does.  Many developers create their classes as globals which is generally frowned up.  I mostly disagree with that stance, but each to their own.  In any event...

  • By
    Responsive and Infinitely Scalable JS Animations

    Back in late 2012 it was not easy to find open source projects using requestAnimationFrame() - this is the hook that allows Javascript code to synchronize with a web browser's native paint loop. Animations using this method can run at 60 fps and deliver fantastic...

Incredible Demos

Discussion

    Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!