Solved

encrypted zip with linux

Posted on 2006-11-25
7
1,607 Views
Last Modified: 2008-01-16
hi

I use this command to ackup and zip my database:

"mysqldump  -h $server -u $username -p$password -q $database | gzip > $path "

is there a way to encrypt the ziped file .. ?

thx
0
Comment
Question by:uk1900
7 Comments
 
LVL 58

Expert Comment

by:amit_g
ID: 18013655
Use crypt ...

crypt YourSecretKey < $path > TheEncryptedFile

To decrypt use

crypt YourSecretKey < TheEncryptedFile >  $path

Don't lose YourSecretKey.
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 100 total points
ID: 18015160
or you could actually use zip.

zip -e .......
0
 

Author Comment

by:uk1900
ID: 18015669
thx guys for your help,

u mean I can write :  zip -e $password   in the following command ?

"mysqldump  -h $server -u $username -p$password -q $database | zip -e $password > $path "
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 58

Accepted Solution

by:
amit_g earned 200 total points
ID: 18015793
If you want to do this in one line,

mysqldump  -h $server -u $username -p$password -q $database | gzip | crypt YourSecretKey > $path

If you want to use zip, you can do

mysqldump  -h $server -u $username -p$password -q $database | zip -e > $path

but in case of zip the password (key) is to be entered on the prompt. The command would propnt you to enter a password twice. You can't give that password in command line.
0
 
LVL 30

Assisted Solution

by:Kerem ERSOY
Kerem ERSOY earned 100 total points
ID: 18017719
Hi,

zip -e  will always ask for apssword from the standard input and if standard input is redirected to soemwhere else it will print an error message and exit. So it is not possible to run it noninteractively.

For crypt is not a standard application I will suggest you to use GnuPGP. It is a part of most inux Distros.

Visit here for usage info:
http://www.somacon.com/p107.php
http://www.cyberciti.biz/tips/linux-how-to-encrypt-and-decrypt-files-with-a-password.html

Cheers,
K.
0
 
LVL 16

Assisted Solution

by:xDamox
xDamox earned 100 total points
ID: 18019904
Hi,

Have you considered using the GnuGPG when you have your keys setup to encrypt files you simply do:

gpg -e file.zip

Have a read of the following guide I did;

http://www.linux-noob.com/forums/index.php?showtopic=1475
0
 

Author Comment

by:uk1900
ID: 18021672
thx guys for your help
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now