Dono Rust crate
🚚 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:
[]
= "1.1.1"
Then in your rust code:
extern crate dono;
This will give you access to the Dono
and DonoError
structs.
Dono
The Dono
struct provides the basic password hashing implementation.
A new instance of Dono
can be created with the new()
function. This gives
you access to the compute_password
function.
extern crate dono;
Label
The Label
struct provides an easy-to-use way to index, create, update and
destroy labels from the store.
Labels have the following attributes:
title
- Holds the current title, represented as a Stringprevious_title
- Holds the last saved title, represented as a Stringpersisted
- Holds a bool value thet indicates if the Label is persisted in the store
Abailable public methods are:
new(label: &String) -> Label
- creates a new Label with the given titlenew_saved(label: &String) -> Label
- same asnew
but setspersisted
to truechanged() -> bool
- returns true if the current and previous title are the samesave() -> Result<&Label, DonoError>
- save the label to the storedestroy() -> Result<&Label, DonoError>
- destroys the label from the store
Module methods:
labels::all()
- returns a Vec with all prebuild Label structs from the store
Example:
extern crate dono;
Errors
This library has a custom error called DonoError
that has the
following string fields in it:
field
- Indicates which parameter caused the errorcode
- A code associated with that errordescription
- Detailed description of what went wrong with possible solutionmessage
- Short description of what went wrong
Error codes:
CP001
- The key is too shortCP002
- Desired password length is too longSV001
- Could not open store fileSV002
- Could not write to store file
OSS used
- rust-crypto - PBKDF2 and SHA256 algorithm impementations
- regex - General regex matching and string replacement
- regex-syntax - String escape for use in regex
- rustc-serialize - Object serialization
Contributing
Contributions are always welcome! Please note that new features and bugfixes
get added on the develop
branch first. So all pull requests should be made
from and to the develop
branch. Also, please check the issues and pull request
pages for simmilar issues and solutions before submitting your own.
When you submit a bug report always add a minimal working example and specify which version of the crate you are using.
Testing is important! Always test the code you submit in a pull request.
License
This project is licensed under the GPLv3. The full license text is available here.