Heavy encrypting files on your linux box

After some nasty run-in with reality I decided to day to take better care of my passwords. By encrypting them with GnuPG, I thought I would stand a much better chance when my laptop gets stolen. I am lazy so I already have my HD encrypted, but, for the super paranoid, as I am becoming more and more, I now also have my passes seperate encrypted in a vault file with 4096 gpg encryption.

How? Very simple; first generate a pub/priv key pair;

gpg –gen-key

then add two files to your path;

enc;


#!/usr/bin/perl

$file = $ARGV[0];
$file1 = $ARGV[1];

if (!$file or !$file1) {
print "Usage: ./enc input outputn";
exit;
}

print `gpg --encrypt --recipient 'Your Name' -o $file1 $file`;

dec;


#!/usr/bin/perl

$file = $ARGV[0];

if (!$file) {
print "Usage: dec inputn";
exit;
}

print `gpg --decrypt $file`;

Then make sure you have zero writing tool to delete the original, to be encrypted, file and you’re all done 🙂

Be the first to leave a comment. Don’t be shy.

Join the Discussion

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>