dono 1.0.0

Rust crate for Dono Key Derivation Function
Documentation

Dono Rust crate

Build Status codecov license

🚚 Rust crate for Dono Key Derivation Function

About Dono

Dono is a password derivation tool which derives passwords from a master Key by using short descriptions of the destination service.

You can read more about the project in it's whitepaper repository or download the PDF.

Usage

To use this crate add the following to your Cargo.toml file:

[dependencies]
dono = "0.1.0"

Then in your rust code:

extern crate dono;

This will give you access to the Dono and DonoError structs. A new instance of Dono can be created with the new() function. This gives you access to the compute_password function.

extern crate dono;

fn main() {
  let dono = dono::Dono::new();

  let key = "this_is_a_long_test_key".to_string();
  let label = "test".to_string();
  let password_length = 64;
  let add_fixed_symbol = false;
  let add_fixed_capital = false;

  let password = dono.compute_password(
    &key, &label, &password_length, &add_fixed_symbol, &add_fixed_capital
  ).unwrap();

  println!("password: {}", password);
}

Errors

This library has a custom error called DonoError that has the following string fields in it:

  • field - Indicates which parameter caused the error
  • code - A code associated with that error
  • description - Detailed description of what went wrong with possible solution
  • message - Short description of what went wrong

Error codes:

  • CP001 - The key is too short
  • CP002 - Desired password length is too long

OSS used

  • rust-crypto - PBKDF2 and SHA256 algorithm impementations

License

This project is licensed under the GPLv3. The full license text is available here.