updated Usage in README and cleaned up libsodium bindings
parent
3fa19b57e3
commit
e65a47a4ac
14
README.md
14
README.md
|
@ -39,6 +39,19 @@ nonce, encrypted = Cox.encrypt(data, bob.public, alice.secret)
|
||||||
decrypted = Cox.decrypt(encrypted, nonce, alice.public, bob.secret)
|
decrypted = Cox.decrypt(encrypted, nonce, alice.public, bob.secret)
|
||||||
|
|
||||||
String.new(decrypted) # => "Hello World!"
|
String.new(decrypted) # => "Hello World!"
|
||||||
|
|
||||||
|
|
||||||
|
# Public key signing
|
||||||
|
|
||||||
|
message = "Hello World!"
|
||||||
|
|
||||||
|
signing_pair = Cox::SignKeyPair.new
|
||||||
|
|
||||||
|
# Sign the message
|
||||||
|
signature = Cox.sign(message, signing_pair.secret)
|
||||||
|
|
||||||
|
# And verify
|
||||||
|
Cox.verify(signature, message, signing_pair.public) # => true
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
@ -52,3 +65,4 @@ String.new(decrypted) # => "Hello World!"
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
- [andrewhamon](https://github.com/andrewhamon) Andrew Hamon - creator, maintainer
|
- [andrewhamon](https://github.com/andrewhamon) Andrew Hamon - creator, maintainer
|
||||||
|
- [dorkrawk](https://github.com/dorkrawk) Dave Schwantes - contributor
|
||||||
|
|
Loading…
Reference in New Issue