Skip to content
/ sse-rb Public

Ruby implementation of Song et al's symmetric searchable encryption scheme

License

Notifications You must be signed in to change notification settings

cryodex/sse-rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##sse-rb

This gem implements symmetric searchable encryption, as described in Song et al, 2000. This scheme provides a secure, simple and fast algorithm for searching over encrypted data. It achieves searchable encryption by crafting, for each word, a special two-layered encryption construct. Given a trapdoor, the server can strip the outer layer and assert whether the inner layer matches a search query. The algorithm performs searches in O(n) time.

###Usage

require 'sse'

key = OpenSSL::Digest::SHA256.digest('')
cipher = SSE::Cipher.new(key)

ciphs = cipher.encrypt_words(key, ["captain", "doctor", "captain"])
words = cipher.decrypt_words(key, ciphs)

puts words == ["captain", "doctor", "captain"] # => true
                                                 
token = cipher.generate_token(key, "captain")    
puts cipher.search_exists(token, ciphs)        # => true
                                                 
puts cipher.search_words(token, ciphs)         # => [0,2]

token = cipher.generate_token(key, "driver")
puts cipher.search_exists(token, ciphs)        # => false

###Credits

A Javascript implementation provided insight into several implementation details. CryptDB provided a reference implementation for the Song et al. paper.

###License

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

About

Ruby implementation of Song et al's symmetric searchable encryption scheme

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages