Overview
For preamble to design philosophy of this crate see GitHub project page.
psh
is a password generator and a password manager library which produces deterministic
passwords for a set of user inputs. It can store previously used aliases and their password
derivation settings in encrypted form in its internal database at $HOME/.psh.db
.
There is a binary target in this crate, a CLI utility that leverages psh
functionality. It
can be installed using the following cargo
command:
Below is an example of how to use psh
in your code:
use ;
let master_password = new;
let psh = new
.expect;
let alias = new;
let password = psh.derive_password;
For greater security it's possible to supply a secret:
# use ;
#
# let master_password = new;
# let psh = new
# .expect;
# let alias = new;
let secret = new;
let password = psh.derive_password;
The third argument to derive_password()
is [CharSet
]:
# use ;
use CharSet;
#
# let master_password = new;
# let psh = new
# .expect;
# let alias = new;
// This password should consist of [a-zA-Z0-9] characters only
let password = psh.derive_password;
To store/remove alias and its settings to/from psh
database:
# use ;
#
# let master_password = new;
let mut psh = new
.expect;
# let alias = new;
let use_secret = true;
let charset = RequireAll;
// Store alias
psh.append_alias_to_db
.expect;
// Remove alias
psh.remove_alias_from_db
.expect;