Skip to content

JIFFinc/rgpg

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rgpg Install gem Build status

A simple Ruby wrapper around gpg command for file encryption. This version only guaranteed to work with gpg 2.0.22 to 2.2.0.

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.

Installation

gem install rgpg

Usage from terminal

This gem adds an rgpg command. Type rgpg for usage information.

API usage

To generate a GPG public-private key pair

require 'rgpg'

Rgpg::GpgHelper.generate_key_pair 'mykey', 'me@example.com', 'Joe Bloggs'

To encrypt a file

require 'rgpg'

Rgpg::GpgHelper.encrypt_file 'mykey.pub', 'myfile.txt', 'myfile.txt.enc'

To decrypt a file

require 'rgpg'

Rgpg::GpgHelper.decrypt_file 'mykey.pub', 'mykey.sec', 'myfile.txt.enc', 'myfile.txt' [, 'secret_key_passphrase']

Licence

rgpg is released under the MIT licence.

About

Simple Ruby wrapper around "gpg" command for file encryption

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%