Topic: Create password protected zip files ...

Most peeps here already know this o course, some may not so ...

Yet another kewl thing #! makes uber easy to do. Sometimes a person might want to backup a for your eyes only file. May want to email it to themselves or whatever and might not want to send it out over the internet in a form anyone who felt like it could read, if they got their grubby hands on your stuff. Not that this is all that big a deal etc. It's just neat, super easy to do ...


So  ... crunchbang to da rescue !


Let's say you/we have a file in the home directory, it's soooo secret, even you aren't allowed to see it ! We're gonna call it supersecretfile.txt cuz it's well ... super secret + funny. We right click on this file, select Create Archive, when the archiver app pops up, we'd name it something mysterious ... Like supersecretfile under Filename ... Then select the zip format. Though other formats will work for this too. Goin with the .zip format here.

We see a thing here called "Other Options" ... We click that, up pops the place to enter whatever password you wanna use. We enter our supersecret password and click the Create button down at the bottom. There you have it, a password protected .zip file to do with as you please. For your eyes only, as long as you don't forget the password ... Doh !


VLL ! wink

Last edited by CBizgreat! (2012-02-01 09:37:24)

Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.

Vll ! = ( Viva la gnu/Linux !)    Vl#!! = ( Viva la #! !)    Last but not least, UD ... OD ! = ( Use Debian ... or die !) tongue

Re: Create password protected zip files ...

If it's just for use on a linux machine, I would recommend ccrypt to do this.
It's very easy:
to encrypt: ccencrypt supersecretfile.txt
to decrypt: ccdecrypt -d supersecretfile.txt

Of course you have to install ccrypt first: sudo apt-get install ccrypt


Some thoughts about your method:
There's a lot of discussion about security of password protected zip files. I've read 7z uses a more secure method than zip.

When you zip the file, the original is still there. Ccrypt will securely overwrite the original file.

Of course everything depends on the level of security you need. Password protected zip files are for alittlebitsecret.txt only. They can also be useful is you want to email a zip file to someone else which can't be opened by just everyone. If you want to send really secure emails, you need pgp (or gnupg).

Re: Create password protected zip files ...

You can also do it from the command line, thusly:

zip --encrypt mysecret.zip supersecretfile.txt

and it will prompt you to provide a password.

Caveats:

1.  filenames inside password protected zip archives are  not necessarily obscured.  If you have a file called MySecretPlansToBreakUpWithMyGirlfriend.txt in the archive she may still be able to see the filename even if she can't access the contents of the file.  She will still be mad at you.

$ zip --encrypt mysecret.zip secret.txt 
Enter password: 
Verify password: 
  adding: secret.txt (stored 0%)

$ unzip mysecret.zip 
Archive:  mysecret.zip
[mysecret.zip] secret.txt password: <-- D'OH!

You can get around this by naming it something innocuous, or embedding it in another zip, or {see below}.

2.  truly important secrets can be very safely protected using serious crypto like the gnupg package (available in repo).  Can use public key or normal symmetrical encryption with those.

Last edited by fratermus (2012-02-01 11:24:31)

brother mouse
new to crunchbang.
my first linux kernel build was on a 386-16sx with 6MB SIPP RAM ($50/MB!)

Re: Create password protected zip files ...

Lol ... appreciate the adds ladies/gents.

Actually learned some stuff here. Was mainly just being a dork o course. Definitely agree a PW protected .zip isn't a digital fort knox ... etc. Butcha gotta admit the supersecretfile.txt thing was kinda funny. tongue Though nowhere near as funny as MySecretPlansToBreakUpWithMyGirlfriend.txt ... That iz friggin classic fratermus. lol


Guessing a PW .zip is ok for plenty of junk. Am glad U 2 added to this thread regardless, thanks. In my case it's probably a good idea to NOT use a super tough encryption thingy, in case I forget the password and hose meself. Least could still have a chance of brute forcing da sucker or summin. Could be a real pain, if your for your eyes only file, became a  ... for nobodies eyes ever again file ... Yowza !



Well unless ya happened to have a buddy in the CIA, NSA .... Add other gestapo govt agencies with alphabet soup names or summin.


smile

Last edited by CBizgreat! (2012-02-01 11:43:23)

Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.

Vll ! = ( Viva la gnu/Linux !)    Vl#!! = ( Viva la #! !)    Last but not least, UD ... OD ! = ( Use Debian ... or die !) tongue

Re: Create password protected zip files ...

Using fcrackszip from the repos, it took my old laptop 24 seconds to brute force my (poor) zip password.   I did limit the search from 1-10 chars upper and lower case (like most fools would choose) for this demo.

time fcrackzip  -u -c aA -l 1-10 secret.zip


PASSWORD FOUND!!!!: pw == test

real    0m24.879s
user    0m0.744s
sys     0m0.628s

This kind of thing is also useful to see how fast your CPU fan can spin...  :-)

Update:  benchmarked to see which zip method was fastest on my machine:

$ fcrackzip -B
 cpmask: (skipped)
 zip1: cracks/s = 4165833
*zip2, USE_MULT_TAB: cracks/s = 5050576

Then used that method with the stock dictionary instead of brute force. Found it in 1.643 seconds:

time fcrackzip -v -m zip2 -u -D -p /usr/share/dict/words secret.zip
found file 'secret.txt', (size cp/uc     27/    15, flags 9, chk 30d9)


PASSWORD FOUND!!!!: pw == test

real    0m1.643s
user    0m0.104s
sys     0m0.048s

Last edited by fratermus (2012-02-01 12:40:37)

brother mouse
new to crunchbang.
my first linux kernel build was on a 386-16sx with 6MB SIPP RAM ($50/MB!)

Re: Create password protected zip files ...

@CBiz:  I've been wondering this for some time now...WTF does "VLL" mean?  Very Loud Laughter?  I can't recall seeing that initialism anywhere else.

while ( ! ( succeed = try() ) );

Re: Create password protected zip files ...

Viva La Levolution smile

Last edited by xaos52 (2012-02-01 16:49:08)

If you poke the bear it is going to come after you.

Re: Create password protected zip files ...

...so shouldn't his moniker be "CBizgleat!"?  (Oh noes...I fear we may lose some Southeast Asian members over this...)

while ( ! ( succeed = try() ) );

Re: Create password protected zip files ...

lol xaos52 .. lol

Pvsage ... originally was supposed to be Viva la gnu/Linux abbreviated. Though Viva la gnu/Linolution has a nice ring to it. Da great FOSS revolution and de dawning of the age of better software would be nice to see. wink

Sheesh that's fast Fratermus ... discouragingly fast. Obviously Tunafish wasn't joking about password protected .zips not being much to speak of. Though honestly do think it's a good idea to use a strong password if someone is going to bother doing it. Any PW I'd use would be 10 or more characters ... blahblahblah.

While babbling, may as well say, also think it's a dang good idea to CAREFULLY type out whatever password someone is going to bother using with this or any other file protection. ESP something that's strong encryption. Can see me or other folks having a careless keystroke, you think the password is one thing, but oops it's off a bit. Good luck EVER getting your file decrypted in that case.

Anyway thanks for the interesting info peeps have shared. Was archiving some junk the other dy and noticed how easy #!'s util was to make PW protected .zips ( again ... or other formats ... that should include 7z too.) So figured would babble about it a bit if anyone wanted that kinda thing.


Viva La gnu/Linux ! wink

Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.

Vll ! = ( Viva la gnu/Linux !)    Vl#!! = ( Viva la #! !)    Last but not least, UD ... OD ! = ( Use Debian ... or die !) tongue