LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Gzip or ANycompress tools with password protection (https://www.linuxquestions.org/questions/linux-newbie-8/gzip-or-anycompress-tools-with-password-protection-45912/)

osho 02-17-2003 09:12 PM

Gzip or ANycompress tools with password protection
 
hi there,

I would need a bit help, I would need to compress directory to one file and put a password on it. it is more likely that I am not looking too much on compression method but on the password protection.

I dont see. that compress, gzip, zip or any tool in linux that I know have such a option. the only thing I can think of to make own script that would handle the protection after the file is being compressed.

Thx Osho

Tormented 02-17-2003 10:06 PM

You can put a password on a zip file by using the zipcloak command:

zipcloak filename.zip

You'll be prompted to enter a password and verification of the
password.
You can type zipcloak -h for a complete list of available options.

osho 02-18-2003 12:15 AM

isnt there something that wouldnt need promt. like take parameter only.

PTBmilo 02-18-2003 02:38 AM

You could use pgp/gpg and encrypt the file with your own pub key I guess.

osho 02-18-2003 03:04 AM

well what if I dont want to have the key there all the time in file. or maybe i dont understand the gpg.

whansard 02-18-2003 04:06 AM

there are many ways for cheap encryption like
passing the input through a filter before and
after compressing like
cat filename | tr whatever | gzip > filename.gz
then to extract
gzip -c filename.gz |tr whatever > filename

i forgot which utility you use to encode a file
using a certain word.

there is also rar for linux which lets you set
a password. rosenthal archiver i think.
sort of like pkzip or arj.

pkzip is also available for linux.

PTBmilo 02-18-2003 02:56 PM

Quote:

Originally posted by whansard
there are many ways for cheap encryption like
passing the input through a filter before and
after compressing like
cat filename | tr whatever | gzip > filename.gz
then to extract
gzip -c filename.gz |tr whatever > filename

i forgot which utility you use to encode a file
using a certain word.

Whansard's got what you want I think. The utility is called crypt :)

Working of the above syntax:

cat filename | crypt [password] | gzip > filename.X.gz

gunzip -c filename.X.gz | crypt [password] > filename


Not the BEST encryption... if it's really important stuff, you should look into another solution.

p.s.- I'm not on unix at the moment, so I can't verify those commands.

EDIT:

P.S.- You wouldn't need the public key to be present for gpg, the comand would be something like:

gpg -e file.gz <user1> <user2>... <userN>

Where <user> would be the user(s) who will be able to decrypt the message.


All times are GMT -5. The time now is 08:17 PM.