KMS.Passphrase (kms v0.1.0)

Copy Markdown View Source

Generates human-friendly high-entropy passphrases for KMS passphrase workflows.

The generator uses Diceware-style five-die rolls. Each word carries about 12.9 bits of entropy (log2(6^5)). The default 10 words exceed KMS' current 128-bit secret policy while staying easier to read and transcribe than raw bytes.

Generated words come from KMS' stable built-in pronounceable word list, not the official EFF/Diceware word lists.

passphrase = KMS.Passphrase.generate()
{:ok, encrypted} = KMS.encrypt_rmk_pdk("secret", passphrase, aad: "document:123/body")

Summary

Functions

Generates a passphrase with word_count Diceware-style words.

Generates a passphrase from explicit dice rolls.

Returns the built-in word list as a stream of Diceware-style roll word lines.

Functions

generate(word_count \\ 10)

Generates a passphrase with word_count Diceware-style words.

Defaults to 10 words, enough for more than 128 bits of generation entropy with this word list. Words are separated by spaces.

generate_from_rolls(dice_rolls)

Generates a passphrase from explicit dice rolls.

Useful for tests, demos, or manual dice workflows.

wordlist()

Returns the built-in word list as a stream of Diceware-style roll word lines.

The list contains 7776 entries, one for each possible five-die roll.