#secret #cargo-toml #shamir #issue

shamir

Shamir is a pure Rust implementation of Shamir's secret sharing

4 stable releases

Uses old Rust 2015

2.0.0 Jan 21, 2020
1.0.2 Jan 24, 2016

#1760 in Cryptography

Download history 75/week @ 2023-08-10 64/week @ 2023-08-17 63/week @ 2023-08-24 63/week @ 2023-08-31 60/week @ 2023-09-07 40/week @ 2023-09-14 40/week @ 2023-09-21 54/week @ 2023-09-28 38/week @ 2023-10-05 58/week @ 2023-10-12 56/week @ 2023-10-19 50/week @ 2023-10-26 74/week @ 2023-11-02 51/week @ 2023-11-09 57/week @ 2023-11-16 38/week @ 2023-11-23

237 downloads per month

MIT license

16KB
303 lines

Shamir

Coverage Status

Build Status

Shamir is a pure Rust implementation of Shamir's secret sharing.

Install

To install shamir into your application, you need to add it to your cargo.toml:

[dependencies]
shamir = "~1.0"

and you need to include it at the top of oyur main.rs:

extern crate shamir;

use shamir::SecretData;

Usage

extern crate shamir;

use shamir::SecretData;

fn main() {
    let secret_data = SecretData::with_secret("Hello World!", 3);

    let share1 = secret_data.get_share(1);
    let share2 = secret_data.get_share(2);
    let share3 = secret_data.get_share(3);

    let recovered = SecretData::recover_secret(3, vec![share1, share2, share3]).unwrap();

    println!("Recovered {}", recovered);
}

Dependencies

~380KB