mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-05-11 20:49:30 +00:00
Bumps [rand](https://github.com/rust-random/rand) from 0.8.5 to 0.9.3. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/0.9.3/CHANGELOG.md) - [Commits](https://github.com/rust-random/rand/compare/0.8.5...0.9.3) --- updated-dependencies: - dependency-name: rand dependency-version: 0.9.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Double Ratchet
This library provides an implementation of the Double Ratchet algorithm.
Usage
let shared_secret = [42u8; 32];
let bob_dh = DhKeyPair::generate();
let mut alice = RatchetState::init_sender(shared_secret, bob_dh.public);
let mut bob = RatchetState::init_receiver(shared_secret, bob_dh);
let (ciphertext, header) = alice.encrypt_message(b"Hello Bob!");
let plaintext = bob.decrypt_message(&ciphertext, header);
Run examples,
cargo run --example double_ratchet_basic
cargo run --example storage_demo --features storage
cargo run --example storage_demo --features sqlcipher
Run Nim FFI example,
# In the root folder (libchat)
cargo build --release
# In ffi-nim-example folder
nimble run