title: Implementing gpg Encryption in Ruby
body: <p>Trying to convert some old shell/unix scripts into Ruby.</p>
  
  <p>I have the following encryption of a file that's accomplished via the gpg tool in Unix. I can pass in the recipient key, the file I want to encrypt, and the outfile to pgp encrypt something.</p>
  
  <pre><code>gpg --recipient "$my_recipient_key" \
      --encrypt "$my_file" \
      --output "$my_outfile" \
      --always-trust \
      --compress-algo zip
  </code></pre>
  
  <p>What's the Ruby equivalent to do a simple encryption as above? </p>
  
  <p>After doing some digging, I see:</p>
  
  <ol>
  <li><a href="http://rubygems.org/gems/openpgp">OpenPGP</a> is popular, but there's no documentation on the RubyGems site and other places are sparse with good examples. </li>
  <li><a href="http://rubygems.org/gems/gpgme">gpgme</a> seems popular and promising. However, I'll be honest, I'm new to Ruby and clicking on the documentation (see link) leaves me a little bit confused about where to start (i.e. a good example would be nice)</li>
  <li>I also see other smaller gems and libraries that users have designed, but I'm restricted to using certified gems from the rubyGems database as this is for official work use.</li>
  </ol>
  
  <p>Thanks!</p>