Crate phraze

source ·

Modules§

  • A couple functions for reading in custom word list files
  • This module contains some functions that help deal with the separating punction between words in a passphrase. Most of it handles cases where the user requests a random symbol or number or either.
  • One thing we definitely want to check user-inputted word lists for is uniform Unicode Normalization. This is because, if the Unicode Normalization is not uniform, that means we two words that look very similar can get through Phraze’s de-duplication check. Having duplicate words in a word list will cause Phraze to OVER-estimate passphrase entropy strength, exactly what we do not want to happen.

Enums§

  • The possible word lists that Phraze can use.

Functions§

  • Given user’s inputs, figure out how many words the generated passphrase will need. If user specified an exact number_of_words, just return that number_of_words. If user is using a strength_count, do the necessary math. If user specified a minimum_entropy, we need to do some math to figure out how many words will clear that minimum.
  • A little helper function to actually calculate the number of words needed to meet a desired minimum entropy, given the length of the word list we’re using.
  • Take enum of list_choice and use the include_lines! macro from crate to read-in the appropriate word list in.
  • Actually generate the passphrase, given a couple neccessary parameters. This function uses some Rust magic to be able to accept a word list as either a &&str (built-in word lists) or as a &String if user provides a file as word list.
  • Print the calculated (estimated) entropy of a passphrase, based on three variables