[ale] Local/Cloud File Encryption

Chris Fowler cfowler at outpostsentinel.com
Sun Aug 18 11:48:06 EDT 2013


On 08/17/2013 03:54 PM, Calvin Harrigan wrote:
> I've been toying with the idea of storing files in the cloud, but for 
> the life of me I can't bring myself to trust most of the companies out 
> there, especially the bigger ones.  What I'm looking for a is a cross 
> platform (linux/windows) encryption methodology that I can use to 
> encrypt files locally and THEN store them in the cloud. I'm sure many 
> are doing something similar, just looking for some pointers.  I've 
> googled about it, while there are many options, I'm looking for some 
> local feedback.  Thanks

I use openssl:

#!/usr/bin/perl

use Getopt::Std;
use vars qw/$opt_d $opt_o $opt_O $opt_p/;
use strict;

my $tmp_file = "/tmp/encrypt.$$";
$opt_d = 0;
$opt_o = 0;
$opt_O = undef;
$opt_p = undef;


sub main {
     getopts "do:O:p:";


     die "$0 [-d] <file>\n" unless $ARGV[0];

     if($opt_O) {
         $tmp_file = $opt_O;
     }

     if($opt_p) {
         $opt_p = " -pass pass:$opt_p ";
     }

     if($opt_d) {
         system "openssl aes-256-cbc -d -a -in $ARGV[0] $opt_p -out 
$tmp_file";
         if($opt_o) {
             system "mv $tmp_file $ARGV[0]";
         } else {
             print "Decrypted file: $tmp_file\n";
         }
     } else {
         system "openssl aes-256-cbc -a -salt -in $ARGV[0] $opt_p -out 
$tmp_file";
         if($opt_o) {
             system "mv $tmp_file $ARGV[0]";
         } else {
             print "Encrypted file: $tmp_file\n";
         }
     }

     return 0;
}

exit main;

# vi: set ts=2 sw=2: #

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20130818/a0663a51/attachment.html>


More information about the Ale mailing list