Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
/ keyczar_ruby Public archive

Ruby wrapper for the Keyczar cryptographic C++ library

Notifications You must be signed in to change notification settings

TrueCar/keyczar_ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 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. Download a zip or clone the repo here: github.com/google/keyczar

keyczar requires gtest. If you don’t already have it, download a copy from code.google.com/p/googletest/downloads and unpack it in a convenient location (you’ll need the path for the build command below).

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

$ cd cpp/src 
$ sh ./tools/swtoolkit/hammer.sh -D GTEST_DIR=YOUR_GTEST_PATH --mode=opt-linux --compat
$ sh ./tools/swtoolkit/hammer.sh -D GTEST_DIR=YOUR_GTEST_PATH --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

No packages published