Seed Keeper Core

Seed Keeper Core is a small Rust library for deriving and encrypting keys and seeds.

Uses Argon2, AES Key Encryption Keys,

Roundtrip Usage

```rust use seedkeepercore::{derivekey}; // the main purpose of this library use seedkeepercore::{Secret, ExposeSecret}; // re-exports to use the derived key use seedkeepercore::wrap::{encrypt, decrypt}; // utils to encrypt and decrypt the seed use seedkeepercore::seed::{Seed, randseed}; // utils to generate a random seed

// Generate a secure random seed of 32 bytes:

let seed: Seed = randseed(); asserteq!(seed.len(), 32);

// Derive key material from a username (salt) and password:

let password = "some random words that you made up, for sure!".to_string(); let salt = b"some@email.com"; // Salt should be unique per password

let key = derive_key(&password, salt).unwrap();

asserteq!( **key.exposesecret(), [ 164, 103, 254, 113, 126, 241, 57, 240, 100, 56, 243, 125, 155, 224, 40, 242, 178, 136, 222, 133, 220, 141, 127, 10, 88, 199, 181, 11, 241, 91, 149, 249 ] );

// Protect your new seed by encrypting it with the password and salt key:

let encrypted = encrypt( (key.exposesecret()).tryinto().unwrap(), // Deref &Seed to [u8; 32] &seed, ); let decrypted = decrypt((key.exposesecret()).tryinto().unwrap(), &encrypted); asserteq!(*seed, *decrypted.asslice()); ```