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
    Introducing MooTools Templated

    One major problem with creating UI components with the MooTools JavaScript framework is that there isn't a great way of allowing customization of template and ease of node creation. As of today, there are two ways of creating: new Element Madness The first way to create UI-driven...

  • By
    LightFace:  Facebook Lightbox for MooTools

    One of the web components I've always loved has been Facebook's modal dialog.  This "lightbox" isn't like others:  no dark overlay, no obnoxious animating to size, and it doesn't try to do "too much."  With Facebook's dialog in mind, I've created LightFace:  a Facebook lightbox...

Incredible Demos

  • By
    Using jQuery and MooTools Together

    There's yet another reason to master more than one JavaScript library: you can use some of them together! Since MooTools is prototype-based and jQuery is not, jQuery and MooTools may be used together on the same page. The XHTML and JavaScript jQuery is namespaced so the...

  • By
    Animated AJAX Record Deletion Using Dojo

    I'm a huge fan of WordPress' method of individual article deletion. You click the delete link, the menu item animates red, and the item disappears. Here's how to achieve that functionality with Dojo JavaScript. The PHP - Content & Header The following snippet goes at the...

Discussion

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