Diceware (diceware v0.2.9)

A library that generates a Diceware passphrase.

A diceware passphrase builds a readable passphrase of 6 (or more) words from a list of 8,192 words.

Creating a passphrase combining readable words helps the user more easily memorize it.

Link to this section Summary

Functions

Dncodes a string to a Diceware.Passphrase provided it was encoded with encode/1

Base64 encodes the given Diceware.Passphrase

Generate a passphrase with at least 6 words.

Return a string of the password with ANSI colors for printing to the console

Link to this section Functions

Link to this function

decode(passphrase)

Specs

Dncodes a string to a Diceware.Passphrase provided it was encoded with encode/1

Link to this function

encode(passphrase)

Specs

Base64 encodes the given Diceware.Passphrase

This DOES NOT provide encryption, but can be passed through a standard string encryption tool like GPG.

Link to this function

generate(opts \\ [])

Specs

generate(Keyword.t()) :: Diceware.Passphrase.t()

Generate a passphrase with at least 6 words.

Takes a keyword list of options:

  • :count - number of words in phrase, defaults to 6
Link to this function

with_colors(passphrase)

Specs

with_colors(Diceware.Passphrase.t()) :: String.t()

Return a string of the password with ANSI colors for printing to the console

Examples

iex> passphrase = Diceware.Passphrase.new(["a", "b", "c"])
iex> Diceware.with_colors(passphrase)
"\e[36ma\e[35mb\e[33mc"