Sha256: e4a806bfb947e05ac7c2bb8c090f27926684af5662b1f217c6b159ac23a6073b

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

## About Ruby_NaCl ##

Ruby_NaCl is a Ruby gem that provides a wrapper around DJB's awesome NaCl library.



## What is NaCl? ##

[NaCl (pronounced "salt")](http://http://nacl.cr.yp.to/) is a new easy-to-use high-speed software library for network communication, encryption, decryption, signatures, etc written by Daniel J. Bernstein.



## Install the gem ##

1. git clone http://github.com/CaffeinatedMind/Ruby_NaCl.git
2. cd Ruby_NaCl
3. git submodule init
4. git submodule update
5. gem build ruby_nacl.gemspec
6. gem install ruby_nacl-0.1.0.gem



## "Hello, World" example ##

```ruby
require 'ruby_nacl'

sender = NaCl.new
receiver = NaCl.new

sender.set_remote_nonce(receiver.nonce)
receiver.set_remote_nonce(sender.nonce)

sender.set_remote_key(receiver.public_key)
receiver.set_remote_key(sender.public_key)

receiver.set_secret(sender.secret)

message = "Hello world!"
encrypted_message = sender.public_encrypt(message)
decrypted_message = receiver.public_decrypt(encrypted_message)
puts decrypted_message
```


## License ##

Ruby_NaCl is licensed under the [Ruby License](http://www.ruby-lang.org/en/LICENSE.txt).

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby_nacl-0.1.2 README.md
ruby_nacl-0.1.1 README.md
ruby_nacl-0.1.0 README.md