<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 08/17/2013 03:54 PM, Calvin Harrigan
wrote:<br>
</div>
<blockquote cite="mid:520FD50A.1050507@gmail.com" type="cite">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
<br>
</blockquote>
<br>
I use openssl:<br>
<br>
<small><font face="Courier New, Courier, monospace">#!/usr/bin/perl<br>
<br>
use Getopt::Std;<br>
use vars qw/$opt_d $opt_o $opt_O $opt_p/;<br>
use strict;<br>
<br>
my $tmp_file = "/tmp/encrypt.$$";<br>
$opt_d = 0;<br>
$opt_o = 0;<br>
$opt_O = undef;<br>
$opt_p = undef;<br>
<br>
<br>
sub main {<br>
getopts "do:O:p:";<br>
<br>
<br>
die "$0 [-d] <file>\n" unless $ARGV[0];<br>
<br>
if($opt_O) {<br>
$tmp_file = $opt_O;<br>
}<br>
<br>
if($opt_p) {<br>
$opt_p = " -pass pass:$opt_p ";<br>
}<br>
<br>
if($opt_d) {<br>
system "openssl aes-256-cbc -d -a -in $ARGV[0] $opt_p
-out $tmp_file";<br>
if($opt_o) {<br>
system "mv $tmp_file $ARGV[0]";<br>
} else {<br>
print "Decrypted file: $tmp_file\n";<br>
}<br>
} else {<br>
system "openssl aes-256-cbc -a -salt -in $ARGV[0] $opt_p
-out $tmp_file";<br>
if($opt_o) {<br>
system "mv $tmp_file $ARGV[0]";<br>
} else {<br>
print "Encrypted file: $tmp_file\n";<br>
}<br>
} <br>
<br>
return 0;<br>
}<br>
<br>
exit main;<br>
<br>
# vi: set ts=2 sw=2: #</font></small><br>
<br>
</body>
</html>