tweetnacl-rs

Crates.iotweetnacl-rs
lib.rstweetnacl-rs
version0.1.3
sourcesrc
created_at2019-05-23 21:40:28.637486
updated_at2019-05-27 13:40:58.286419
descriptionTweetNacl library, re-export from sodalite.
homepagehttps://github.com/clearloop/tweetnacl-rs
repositoryhttps://github.com/clearloop/tweetnacl-rs
max_upload_size
id136503
size11,385
(clearloop)

documentation

https://docs.rs/tweetnacl-rs

README

tweetnacl-rs

Crates.io Crates.io LICENSE

re-export from sodalite.

Usage

You can test the keypair in command line directly, for example:

$ cargo install tweetnacl-rs
$ tweetnacl-rs
tweetnacl-rs
============
Usage: tweetnacl-rs <Command> <args>

Commands:
  gen     <nil>                               => generate keypair
  sign    <message> <secretkey>               => sign message
  verify  <message> <signature> <publickey>   => verify message

$ tweetnacl-rs gen
public-key: "aa73d5a6c526bbad121a0c44d84cf31ae705bbadaf1221759a4da10e6d8fdcf1"
secret-key: "cb6e6713a8c2aba686b0ad4d7d914f1a9a31ee450a3d60b7d979131c045066a9aa73d5a6c526bbad121a0c44d84cf31ae705bbadaf1221759a4da10e6d8fdcf1"

Or your can use tweetnacl-rs as a library:

use tweetnacl_rs::gen;
use tweetnacl_rs::TweetNacl;

fn main() {
    let (pk, sk) = gen();
    println!("public key: {:?}", pk);
    println!("secret key: {:?}", sk.to_vec());

    let sm = sk.sign("hello, world".to_string());
    println!("signed message: {:?}", sm.to_vec());

    let ret = pk.verify("hello, world".to_string(), &sm);
    assert_eq!(ret, true);
}

LICENSE

MIT

Commit count: 4

cargo fmt