In the need for a quick pipeline to encrypt and decrypt data, gpg can be quite handy, for example it can be used in this way to encrypt  some backup before transferring it to a third part hosted  storage:

cat backupfile.tgz | gpg -c --cipher-algo=BLOWFISH > backupfile.tgz.gpg

(you’ll be asked for the Passphrase to use for encryption)
and for decryption:

cat backupfile.tgz.gpg |gpg -d --cipher-algo=BLOWFISH > backupfile.tgz

(you’ll be obviously asked for the Passphrase again, don’t forget it and save it in a safe place!)

To use it inside a script (batch process) the useful --passphrase switch
can be employed:

cat backupfile.tgz | gpg -c –cipher-algo=BLOWFISH --passphrase abcdefghi1234567890 > backupfile.tgz.gpg

in this case, do not forget to set 700 the file for avoiding unwanted reading…

Share and Enjoy:
  • Facebook
  • Twitter
  • Tumblr
  • del.icio.us
  • PDF
  • RSS
  • email
  • LinkedIn
  • HackerNews
  • Google Bookmarks
  • Digg
  • MySpace
  • Technorati
  • Reddit
  • Blogosphere News
  • Identi.ca
  • Netvibes
  • Ping.fm
  • Simpy
  • StumbleUpon

Tags: , , , ,

One Response to “Quick data pipeline for encryption and decryption”

  1. admin says:

    To be used with an external storage solution, such as Amazon S3, see for example this thread:
    http://geekery.etherknet.com/w......php?p=229

Leave a Reply

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