Code Monkey home page Code Monkey logo

openpgp.rb's Introduction

OpenPGP.rb: OpenPGP for Ruby

This is a pure-Ruby implementation of the OpenPGP Message Format (RFC 4880).

About OpenPGP

OpenPGP is the most widely-used e-mail encryption standard in the world. It is defined by the OpenPGP Working Group of the Internet Engineering Task Force (IETF) Proposed Standard RFC 4880. The OpenPGP standard was originally derived from PGP (Pretty Good Privacy), first created by Phil Zimmermann in 1991.

Features

  • Encodes and decodes ASCII-armored OpenPGP messages.
  • Parses OpenPGP messages into their constituent packets.
    • Supports both old-format (PGP 2.6.x) and new-format (RFC 4880) packets.
  • Includes a GnuPG wrapper for features that are not natively supported.

Examples

require 'rubygems'
require 'openpgp'

Decoding an ASCII-armored message

require 'open-uri'
text = open('http://openpgp.rubyforge.org/pgp.txt').read

msg = OpenPGP::Message.parse(OpenPGP.dearmor(text))

Generating a new keypair

gpg = OpenPGP::Engine::GnuPG.new(:homedir => '~/.gnupg')
key_id = gpg.gen_key({
  :key_type      => 'DSA',
  :key_length    => 1024,
  :subkey_type   => 'ELG-E',
  :subkey_length => 1024,
  :name          => 'J. Random Hacker',
  :comment       => nil,
  :email         => '[email protected]',
  :passphrase    => 'secret passphrase',
})

Documentation

Dependencies

  • Ruby (>= 1.8.7) or (>= 1.8.1 with [Backports][])
  • Open4 (>= 1.0.1)

Installation

The recommended installation method is via RubyGems. To install the latest official release of OpenPGP.rb, do:

% [sudo] gem install openpgp             # Ruby 1.8.7+ or 1.9.x
% [sudo] gem install backports openpgp   # Ruby 1.8.1+

Download

To get a local working copy of the development repository, do:

% git clone git://github.com/bendiken/openpgp.git

Alternatively, you can download the latest development version as a tarball as follows:

% wget http://github.com/bendiken/openpgp/tarball/master

Resources

Authors

Contributors

Contributing

  • Do your best to adhere to the existing coding conventions and idioms.
  • Don't use hard tabs, and don't leave trailing whitespace on any line.
  • Do document every method you add using YARD annotations. Read the tutorial or just look at the existing code for examples.
  • Don't touch the .gemspec or VERSION files. If you need to change them, do so on your private branch only.
  • Do feel free to add yourself to the CONTRIBUTORS file and the corresponding list in the the README. Alphabetical order applies.
  • Don't touch the AUTHORS file. If your contributions are significant enough, be assured we will eventually add you in there.
  • Do note that in order for us to merge any non-trivial changes (as a rule of thumb, additions larger than about 15 lines of code), we need an explicit public domain dedication on record from you.

License

OpenPGP.rb is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.

openpgp.rb's People

Contributors

artob avatar klacointe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.