LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   set password when bzipping/tarring/gzipping (https://www.linuxquestions.org/questions/linux-software-2/set-password-when-bzipping-tarring-gzipping-272570/)

alice95089 01-01-2005 10:29 AM

set password when bzipping/tarring/gzipping
 
Hi All,
Normally. we use the command like tar cvfj or tar cvfz to bzip or gzip a file without setting a passwd, I would like to ask, how can i zip my file at the same time give it a passwd?

Thanks

PBSchmidt 01-01-2005 11:05 AM

Hi alice95089,

well if it is the MSDOS zip encryption you are looking for, I cannot get a solution right from my head. The "ziop Passwords" are not worth using, the net is full of crackz for this. But, to get a much better encrypted file, how about using GPG for this?

Steps:
  • tar the files w/o encryption
  • gpg them with the pub-key of the recipient
  • gzip / bz2 the stuff
  • send it to the recipient

Is that what you are looking for?

HTH, Peter

alice95089 01-02-2005 08:33 AM

Hi Peter,
What i mean is that setting passwd to the file just like the zip file we use in Window, I am sorry that i forgot to mean i want to do that under linux environment....

If i want to do it under linux by using gzip, what can i do ?

Thanks
Alice

PBSchmidt 01-02-2005 01:37 PM

Hi Alice,

the "zip " utility is also available in Linux, see man zip - the option is "-e".

As I mentioned, this is no strong encryption, whoever is willing to spend an hour in attempt to crack it, will succeed.

HTH,

Peter

daihard 01-02-2005 02:05 PM

Some UNIX flavours (such as Solaris and HP-UX) include the tool called "crypt," which encrypts/decrypts files with a passkey. I wonder if there's a version that runs on Linux?

qwijibow 01-02-2005 03:02 PM

Quote:

Some UNIX flavours (such as Solaris and HP-UX) include the tool called "crypt," which encrypts/decrypts files with a passkey. I wonder if there's a version that runs on Linux?
its called GPG

daihard 01-02-2005 03:37 PM

Quote:

Originally posted by qwijibow
its called GPG
Does it work exactly like "crypt"? The syntax for "crypt" is as follows:
Code:

$ crypt -s password < original.file > encrypted.file
I've found the "crypt" executable that does run on Linux, by the way. :)

qwijibow 01-02-2005 04:10 PM

Quote:

Does it work exactly like "crypt"? The syntax for "crypt" is as follows:
of-course it doesnt !
however it has a similar functionality, encrypting things,

it uses a public / private key encryption method.
so its much better system for encrypting things that the user is planning on sending to someone else.

shodekiagari 01-02-2005 04:16 PM

a slight hijack, sorry :(
 
If I could hijack this thread slightly, I was wondering. Does anyone know of any tools to decrypt gpg files under windows/osx? (preferrably graphical?) It's easy to do it from linux to linux client (kgpg) but I wouldn't know how with other os's.

Thanks.

daihard 01-02-2005 04:30 PM

Quote:

Originally posted by qwijibow
of-course it doesnt !
however it has a similar functionality, encrypting things,

it uses a public / private key encryption method.
so its much better system for encrypting things that the user is planning on sending to someone else.

Care to show me exactly how it works, then? I did create keys using "gpg --gen-key" to use them with KMail. I type in the command as follows:
Code:

$ gpg --encrypt my.file
It asks for a user ID, so I type in my own user ID. Now when I try to decrypt it using the following command, it asks me for a passphrase.
Code:

$ gpg --decrypt my.file.gpg
So I type in my passphrase to decrypt it.

Does it mean I have to give my own passphrase to whoever needs to decrypt the file, or am I missing something?

qwijibow 01-02-2005 10:56 PM

i think gpg has a windows version ??? if not, i think PGP for windows will decrypt gpg.

How GPG works...
you greate a public and private key pair like you did. you share your public key with the world.

if you want to send someone an encrypted file, they give you their public key, you encrypt the file with the other persons public key.. then the other person can decrypt the file with their private key, and password.

so no, you dont need to give anyone your password or private key, just your public key.

daihard 01-03-2005 12:55 AM

Quote:

Originally posted by qwijibow
you greate a public and private key pair like you did. you share your public key with the world.

if you want to send someone an encrypted file, they give you their public key, you encrypt the file with the other persons public key.. then the other person can decrypt the file with their private key, and password.

so no, you dont need to give anyone your password or private key, just your public key.

Thanks for the info; it's becoming clearer now. So if I wanted to encrypt a file for you, do you first send me the public key file that you created via "gpg -a --export qwijibow," and I then import the file into my keyring using "gpg --import qwijibow.gpg"?

Assuming it's correct, then I encrypt the file using the following command:
Code:

$ gpg -r qwijibow --output myfile.gpg --encrypt myfile.doc
Am I getting it right?

qwijibow 01-03-2005 09:43 AM

Yep.

but i normally wouldnt send you my public key, i would just make it available for download to te public on my web page, or in the .sig of emails or forum posts,
that way anyone wanting to send me an encrypted email or message wouldnt have to ask me for my key first.

im not too good with the command line, i very rarely need to encrypt things, and when i do, i use a graphical frontend like "kpgp" for KDE.

PBSchmidt 01-03-2005 10:18 AM

Windows Version of GPG
 
You may find the Windows Version at:

http://www.gnupg.org

(see http://www.gnupg.org/(en)/download/s...d_systems.html)

The german "gnupp" Project has set up a very good site http:///www.gnupp.de (unfortunately only in german language) to spread this technology.

I recommend the GTK Key Manager, the "Windows Privacy Tray" also works, but to me the GTK version is more common.

HTH,

Peter

daihard 01-03-2005 03:09 PM

Quote:

Originally posted by qwijibow
Yep.

but i normally wouldnt send you my public key, i would just make it available for download to te public on my web page, or in the .sig of emails or forum posts,
that way anyone wanting to send me an encrypted email or message wouldnt have to ask me for my key first.

I see. So you export your public key into a key file and then place it (and the link to it) on your Web site, right? I should try that myself, too.

Thanks!
Dai


All times are GMT -5. The time now is 03:28 AM.