Skip to content

Ruby wrapper for the Keyczar cryptographic C++ library

Notifications You must be signed in to change notification settings

dwillett/keyczar_ruby

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A ruby interface to the keyczar crypto library. Provides basic encrypt, decrypt, sign and verify methods. This is just a wrapper around the c++ version of keyczar. You will need keyczar-cpp in order to use it. Find keyczar-cpp here: code.google.com/p/keyczar/downloads/list

For now, we assume that keyczar-cpp was installed with the prefix /usr/local. You should be able to install it with these commands:

$ cd keyczar-cpp/src 
$ sh ./tools/swtoolkit/hammer.sh --mode=opt-linux --compat
$ sh ./tools/swtoolkit/hammer.sh --mode=opt-linux --compat install

replace opt-linux above by opt-bsd or opt-mac depending on your system

Methods:

Keyczar::Crypter#encrypt(plaintext)    #=> cryptext
Keyczar::Crypter#decrypt(cryptext)     #=> plaintext
Keyczar::Signer#sign(text)             #=> signature
Keyczar::Signer#verify(text,signature) #=> true or false

The first 3 return empty string on error. #encrypt and #sign results are base64 encoded.

The first 3 return nil when passed nil. The 4th returns false when passed a nil for either text or signature.

Installation

Simple:

$ gem install keyczar_ruby

For bundler, add it to your Gemfile and run

$ bundle install

About

Ruby wrapper for the Keyczar cryptographic C++ library

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • C++ 61.3%
  • Ruby 38.7%