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
    CSS vs. JS Animation: Which is Faster?

    How is it possible that JavaScript-based animation has secretly always been as fast — or faster — than CSS transitions? And, how is it possible that Adobe and Google consistently release media-rich mobile sites that rival the performance of native apps? This article serves as a point-by-point...

  • By
    Serving Fonts from CDN

    For maximum performance, we all know we must put our assets on CDN (another domain).  Along with those assets are custom web fonts.  Unfortunately custom web fonts via CDN (or any cross-domain font request) don't work in Firefox or Internet Explorer (correctly so, by spec) though...

Incredible Demos

  • By
    Record Text Selections Using MooTools or jQuery AJAX

    One technique I'm seeing more and more these days (CNNSI.com, for example) is AJAX recording of selected text. It makes sense -- if you detect users selecting the terms over and over again, you can probably assume your visitors are searching that term on Google...

  • By
    Introducing MooTools ScrollSide

    This post is a proof of concept post -- the functionality is yet to be perfected. Picture this: you've found yourself on a website that uses horizontal scrolling instead of vertical scrolling. It's an artistic site so you accept that the site scrolls left to right.

Discussion

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