ruby >= 1.9.3
libsodium >= 1.0.1
brew install libsodium
gem install --prerelease jodid
bob_chain = Jodid::Keychain.new
bob_public_key = bob_chain.auth('bob', 'bob')
bob = bob_chain.verify('bob', 'bob')
ciphertext = bob.secretbox('plaintext')
bob.secretbox_open(ciphertext)
alice_chain = Jodid::Keychain.new
alice_chain.store_public_key('bob', bob_public_key)
alice_public_key = alice_chain.auth('alice', 'alice')
bob_chain.store_public_key('alice', alice_public_key)
alice = alice_chain.verify('alice', 'alice')
ciphertext = bob.box('hello', 'alice')
puts alice.box_open(ciphertext)
puts alice_chain.fetch_identity(ciphertext[0...Crypto::Box::PUBLICKEYBYTES])
message = 'good morning'
sigature = alice.sign_detached(message)
alice.sign_verify_detached(signature, message)