A simple Ruby wrapper around gpg
command for file encryption
rgpg is a simple API for interacting with the gpg
tool. It is specifically designed to avoid altering global keyring state by creating temporary public and secret keyrings on the fly for encryption and decryption.
gem install rgpg
This gem adds an rgpg
command. Type rgpg
for usage information.
require 'rgpg'
Rgpg::GpgHelper.generate_key_pair 'mykey', '[email protected]', 'Joe Bloggs'
require 'rgpg'
Rgpg::GpgHelper.encrypt_file 'mykey.pub', 'myfile.txt', 'myfile.txt.enc'
require 'rgpg'
Rgpg::GpgHelper.decrypt_file 'mykey.pub', 'mykey.sec', 'myfile.txt.enc', 'myfile.txt' [, 'secret_key_passphrase']
rgpg is released under the MIT licence.