LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-24-2008, 06:11 PM   #1
jedilost1
Member
 
Registered: Oct 2008
Posts: 45

Rep: Reputation: 15
Talking Password Protected compressed files script


I have been researching the possibility of using the Zip -e command in Linux to encrypt and compress a file with success. I am trying to find out if there is a script or someone can help me create one that i can run to automate password protection and compression of an entire directory. Please someone help me, it would be greatly appreciated and would help me get out of a big protection problem at the workplace. Thanks.
 
Old 11-24-2008, 06:22 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Why do you need a script? You could simply use the -r switch.
 
Old 11-24-2008, 06:42 PM   #3
jedilost1
Member
 
Registered: Oct 2008
Posts: 45

Original Poster
Rep: Reputation: 15
as far as i know the limitation on the files is 2gb for ZIP encryption. Is there a way to bypass that limit?
I'm really looking for a way to tar, zip or rar a directory with password protection. I've tried to no avail with the ZIP utility as one employees backups are around 3gb and everyone else's being around 900mb and two others 1.5gb.
I'm looking for a hint that can help me with this issue. I'm very familiar with many parts of linux shell scripting, but perl scripting and others like it i am not. If someone has a solution using one of these languages, i would be more than happy to learn.

Last edited by jedilost1; 11-24-2008 at 06:51 PM.
 
Old 11-24-2008, 06:49 PM   #4
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
Not sure (by any means) but I think that limitation had to do with older MS disk formats having that limit and not ZIP itself.
 
Old 11-24-2008, 06:50 PM   #5
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by jedilost1 View Post
as far as i know the limitation on the files is 2gb for ZIP encryption. Is there a way to bypass that limit?
I'm not sure that such limit exists. In case it does exist, then
you could use another archiver. or you could encrypt archive with GnuPG.
 
Old 11-24-2008, 07:00 PM   #6
jedilost1
Member
 
Registered: Oct 2008
Posts: 45

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ErV View Post
I'm not sure that such limit exists. In case it does exist, then
you could use another archiver. or you could encrypt archive with GnuPG.
what other compression archiver supports encryption? I've been trying to look up gzip or tar and can't find any info on encrypting.
 
Old 11-24-2008, 07:07 PM   #7
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
the zip manual itself suggests using pgp to encrypt a zip archive. You can pipe any archiver through gpg (openpgp).
 
Old 11-24-2008, 07:12 PM   #8
jedilost1
Member
 
Registered: Oct 2008
Posts: 45

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by billymayday View Post
the zip manual itself suggests using pgp to encrypt a zip archive. You can pipe any archiver through gpg (openpgp).
Unfortunately i am not familiar with gpg, i am going to research further. Here is a copy of my crudely made script. Thank you for your help.

#Script to compress and encrypt Backup Files and FTP it to Buffalo Device
#written by jedilost1
zip -e -r backup.zip /export/PrimeView/Staff/
#perl ftpput.pl -H 10.0.30.3 -u backup -p primev -d /disk1/backup /home/igor/backup/backup.zip
mv backup.zip /export/PrimeView/Staff/Miguel
rm -rf backup.zip
 
Old 11-24-2008, 07:24 PM   #9
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by jedilost1 View Post
what other compression archiver supports encryption? I've been trying to look up gzip or tar and can't find any info on encrypting.
rar and 7zip support encryptions. Both are available for linux. 7zip is opensource, rar is not.

Quote:
Originally Posted by jedilost1 View Post
Unfortunately i am not familiar with gpg,
It is never too late to learn. Google for GnuPG tutorial or gpg tutorial. Also there is "The GNU Privacy Handbook"(also available as pdf somewhere) which explains how to use it.

Last edited by ErV; 11-24-2008 at 07:28 PM.
 
Old 11-24-2008, 07:28 PM   #10
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You could do something like
Code:
tar -cjf - /export/PrimeView/Staff | gpg -c --output backup.tar.bz2.gpg
 
Old 11-24-2008, 07:58 PM   #11
jedilost1
Member
 
Registered: Oct 2008
Posts: 45

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by billymayday View Post
You could do something like
Code:
tar -cjf - /export/PrimeView/Staff | gpg -c --output backup.tar.bz2.gpg
thank you so much for the help..
Is there a windows utility that could help me decrypt and get this information back. Plus, what is the code to untar in linux?
It seems to be working though, you guys are the best.
 
Old 11-24-2008, 08:23 PM   #12
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You could use
Code:
gpg -d tmp.tar.bz2.gpg | tar -xjf -
Not sure about the Windows side
 
Old 11-24-2008, 08:26 PM   #13
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Looks like there's a windows gpg http://www.gnupg.org/download/index.en.html

Not sure about untaring though
 
Old 11-25-2008, 12:03 PM   #14
jedilost1
Member
 
Registered: Oct 2008
Posts: 45

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by billymayday View Post
You could use
Code:
gpg -d tmp.tar.bz2.gpg | tar -xjf -
Not sure about the Windows side
thanks man the command worked
i would get an integrity error though when i used it

these are exact error msgs

bzip2: (stdin): trailing garbage after EOF ignored
gpg: WARNING: message was not integrity protected
tar: Child died with signal 13
tar: Error exit delayed from previous errors

Last edited by jedilost1; 11-25-2008 at 12:15 PM.
 
Old 11-25-2008, 01:11 PM   #15
jedilost1
Member
 
Registered: Oct 2008
Posts: 45

Original Poster
Rep: Reputation: 15
Does anyone know how to integrity protect a gpg encrypted file?
I keep getting this message once i decrypt the archive file

Quote:
gpg: WARNING: message was not integrity protected
i'm sorry i've found out that this message comes out only when not using a public key for encryption, the -c makes it a conventional encryption and supposedly this is a normal message when using it.

Source

Last edited by jedilost1; 11-25-2008 at 02:57 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
extracting from password protected zip files sanjith11 Linux - Software 4 03-21-2006 09:14 AM
extracting compressed torrent downloads that are password protected aw76 Linux - General 2 11-26-2005 04:21 AM
accessing files in password protected account on another mnt Cinematography Linux - General 10 05-12-2005 02:52 PM
extracting password protected rar files Cinematography Linux - Software 4 05-09-2005 08:48 PM
Password Protected rar files on Linux Mandrake 9.1 gregonite Linux - Newbie 2 01-23-2005 07:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration