Expand description
A Rust library for generating random passwords and passphrases
Overview
PassPhrase (PSPH) is a Rust library that empowers developers to
elevate the security of their applications with ease. PSPH
generates secure and strong passphrases using a unique combination
of letters, numbers, cases, and symbols to form an unpredictable
string of characters that doesn’t resemble words or names with a
high level of entropy.
Features
- Generate a random password / passphrase.
- Calculate the entropy of a password.
- Calculate the hash of a password.
- Calculate the hash length of a password.
- Check if a password is empty.
- Get the length of a password.
- Get the generated password / passphrase.
Usage
serde
: Enable serialization/deserialization via serde
Structs
Contains several commonly used mathematical and cryptographic
constants.
The
Constants
structure holds mathematical and hash constants.A random password / passphrase generator. The generated password
is a string of three words separated by hyphens. Each word is
between 6 and 8 characters long. The first character of each word
is capitalized.
The Random struct is used to generate random numbers using the
Mersenne Twister algorithm. It generates pseudorandom integers
uniformly distributed in 0..(2^32 - 1) starting from any odd seed in
0..(2^32 - 1).
Enums
Enum to represent the different constant values.
Constants
The mathematical constant
E
, the base of the natural logarithm.The hash algorithm used. The default is Blake3.
The cost of the hash algorithm. The default is 8.
The length of the hash. The default is 32.
The mathematical constant
φ
or the golden ratio.The mathematical constant
π
.The Planck constant,
h
.A set of special characters.
The square root of 5.
words
The list of words.