LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-05-2009, 12:49 PM   #1
Doomhammer
Member
 
Registered: Oct 2003
Location: Montreal Qc, Canada
Posts: 105

Rep: Reputation: 15
I want my script to automatically encrypt my files.


Hi there

I would like my backup script to automatically encrypt my files that are sent to an external host via scp.
So in the script, just before scp is called, i would like to pass an encryption command..

I know a couple encryption tools, like gpg and bcrypt, but they require a user input for the passphrase...

Is it a possible thing to do?

Cheers,
 
Old 06-05-2009, 01:00 PM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
several options.. using keys with gpg being one of them..

http://sleepyhead.de/howto/?href=crypt
 
Old 06-05-2009, 01:04 PM   #3
grepmasterd
Member
 
Registered: Aug 2003
Location: Seattle
Distribution: ubuntu, lately
Posts: 182
Blog Entries: 1

Rep: Reputation: 35
Code:
openssl enc -e -aes256 -in somefile.txt -out somefile.txt.encr -pass pass:"mypasswd"
documented under 'man enc'

be sure to protect your backup script!
 
Old 06-05-2009, 08:46 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Also note that if you pass a password to openssl on the command line like that, anyone who runs 'ps' on the system while openssl is running will see the password!
 
Old 06-06-2009, 09:32 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I agree and I would like to emphasise that encryption is worthless when the passphrase can be read from disk or memory.
 
Old 06-06-2009, 10:12 AM   #6
grepmasterd
Member
 
Registered: Aug 2003
Location: Seattle
Distribution: ubuntu, lately
Posts: 182
Blog Entries: 1

Rep: Reputation: 35
I've been called out! I guess I'm too used to running on single user systems...

"worthless" is a bit extreme. SSL, GPG, IPSec, SSH etc all use encryption keys read from disk, and they are hardly "worthless".

The right approach is to just be careful about when keys might be exposed and mitigate against those cases.
 
Old 06-06-2009, 01:26 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by grepmasterd View Post
"worthless" is a bit extreme. SSL, GPG, IPSec, SSH etc all use encryption keys read from disk, and they are hardly "worthless".
Sure, but that's a different context. In this context (which is the same as people wanting to use LUKS or run an obfuscated binary combined with automagically providing the passphrase) it almost always is. It's not the encryption method that's the problem here, but the way it's misused. I mean, if this practice would have been secure (channel, sender or message integrity) AND convenient it would already have been provided for, wouldn't it?..


Quote:
Originally Posted by grepmasterd View Post
The right approach is to just be careful about when keys might be exposed and mitigate against those cases.
I agree, though depending on what the recipient expects the integrity/security to be I wonder the user knows what is then expected from him...
 
  


Reply



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
[SOLVED] how to encrypt shell script bkcreddy17 Linux - Newbie 2 04-08-2009 06:51 AM
Script to automatically convert video files using ffmpeg jroyce Linux - Software 3 01-04-2008 11:17 PM
encrypt shell script Swakoo Linux - Security 29 02-08-2007 07:16 PM
How to encrypt files wwnexc Linux - Software 1 09-25-2006 08:40 PM
Compile/Encrypt Bash Script DoubleOTeC Programming 6 10-09-2005 07:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:03 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