/ope-rb

Ruby implementation of Boldyreva's order-preserving encryption scheme

Primary LanguageRubyOtherNOASSERTION

ope-rb

This gem implements order-preserving symmetric encryption, as described in Boldyreva, 2009.

Usage

require 'ope'

cipher = OPE::Cipher.new(key)
a = cipher.encrypt(456789)
b = cipher.encrypt(891234)

puts b > a     # =>  true

Credits

CryptDB provided a reference implementation for the Boldyreva paper. The code from Caesar was helpful in understanding how the scheme worked from a high-level perspective. The hypergeometric distribution code was adapted from a Fortran implementation from the Association for Computing Machinery and a C implementation used by the R project.

License

This software is released under the GNU Affero General Public License. If this license does not suit your needs, please contact me.