Crate psph

Source
Expand description

§A Rust library for generating random passwords and passphrases

Rust

Rust Crates.io Lib.rs GitHub License

§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§

Constant
constants Contains several commonly used mathematical and cryptographic constants.
Constants
constants The Constants structure holds mathematical and hash constants.
Hash
A struct for storing and verifying hashed passwords based on the blake3 crate.
Password
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.
Random
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§

ConstantValue
constants Enum to represent the different constant values.

Constants§

EULER
constants The mathematical constant E, the base of the natural logarithm.
HASH_ALGORITHM
constants The hash algorithm used. The default is Blake3.
HASH_COST
constants The cost of the hash algorithm. The default is 8.
HASH_LENGTH
constants The length of the hash. The default is 32.
PHI
constants The mathematical constant φ or the golden ratio.
PI
constants The mathematical constant π.
PLANCK
constants The Planck constant, h.
SPECIAL_CHARS
constants A set of special characters.
SQRT5
constants The square root of 5.
WORD_LIST
words The list of words.