?
Solved

encrypted zip with linux

Posted on 2006-11-25
7
Medium Priority
?
1,616 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 400 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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 58

Accepted Solution

by:
amit_g earned 800 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 400 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 400 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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month13 days, 7 hours left to enroll

800 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