LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-01-2005, 10:29 AM   #1
alice95089
Member
 
Registered: Dec 2004
Location: hong kong
Posts: 44

Rep: Reputation: 15
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
 
Old 01-01-2005, 11:05 AM   #2
PBSchmidt
Member
 
Registered: Aug 2004
Location: Aachen, Germany
Distribution: Debian Sarge
Posts: 129

Rep: Reputation: 15
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

Last edited by PBSchmidt; 01-01-2005 at 11:07 AM.
 
Old 01-02-2005, 08:33 AM   #3
alice95089
Member
 
Registered: Dec 2004
Location: hong kong
Posts: 44

Original Poster
Rep: Reputation: 15
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
 
Old 01-02-2005, 01:37 PM   #4
PBSchmidt
Member
 
Registered: Aug 2004
Location: Aachen, Germany
Distribution: Debian Sarge
Posts: 129

Rep: Reputation: 15
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

Last edited by PBSchmidt; 01-02-2005 at 01:38 PM.
 
Old 01-02-2005, 02:05 PM   #5
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
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?
 
Old 01-02-2005, 03:02 PM   #6
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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
 
Old 01-02-2005, 03:37 PM   #7
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
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.
 
Old 01-02-2005, 04:10 PM   #8
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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.
 
Old 01-02-2005, 04:16 PM   #9
shodekiagari
Member
 
Registered: Nov 2003
Posts: 47

Rep: Reputation: 15
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.
 
Old 01-02-2005, 04:30 PM   #10
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
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?
 
Old 01-02-2005, 10:56 PM   #11
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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.
 
Old 01-03-2005, 12:55 AM   #12
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
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?
 
Old 01-03-2005, 09:43 AM   #13
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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.
 
Old 01-03-2005, 10:18 AM   #14
PBSchmidt
Member
 
Registered: Aug 2004
Location: Aachen, Germany
Distribution: Debian Sarge
Posts: 129

Rep: Reputation: 15
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

Last edited by PBSchmidt; 01-03-2005 at 10:21 AM.
 
Old 01-03-2005, 03:09 PM   #15
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
What should I do to set root password backpacker Linux - Newbie 1 06-10-2005 03:19 AM
tarring a dd stream john8675309 Linux - Software 1 04-22-2005 03:04 PM
Shell Script for Gzipping with date output Junior41180 Programming 1 10-16-2004 06:39 AM
Bzipping takes a really long time sometimes scott_R General 0 10-10-2004 12:47 AM
How to set no password rquin66 Fedora 17 01-01-2004 04:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:05 AM.

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