ShieldX Toolly
Open a tool Donate
Home Home
Blog Blog
FAQ FAQ
Open a tool Donate
Back to cheatsheets
Passwords

Passphrase Generation (EFF Diceware)

Generate memorable EFF Diceware passphrases with CSPRNG selection — ~77 bits at 6 words.

2 snippets Beginner passphrase-generator
EFF Dicewarepassphrasememorable77 bits

What you'll learn

  • Diceware passphrase generator
  • Entropy per word count

How to use these snippets

  1. Click the Copy button next to any snippet to copy it to your clipboard.
  2. Paste the code into your project, IDE, or terminal.
  3. Replace placeholder values (like example.com or your-secret) with your actual data.
  4. Review the code comments for important security notes and caveats.
  5. Try the interactive related tool to see the concept in action.
Code Snippets

Copy-paste code snippets

2 ready-to-use snippets for passphrase generation (eff diceware). Click copy and paste into your project.

Diceware passphrase generator
                // Requires EFF word list (7,776 words)
const WORDS = ['apple', 'brave', 'cloud', ...]; // eff.json

function passphrase(wordCount = 6) {
  const arr = new Uint32Array(wordCount);
  crypto.getRandomValues(arr);
  return Array.from(arr, n =>
    WORDS[n % WORDS.length]
  ).join('-');
}
// 6 words × log2(7776) = ~77.5 bits of entropy
              
Entropy per word count
                function passphraseEntropy(words) {
  return (Math.log2(7776) * words).toFixed(1);
}
// 4 words → 51.6 bits
// 5 words → 64.5 bits
// 6 words → 77.5 bits
// 7 words → 90.5 bits
// 8 words → 103.4 bits
              
Tool

Try this concept hands-on with the interactive tool.

100% Free · No signup · No cost

Generate something unguessable right now

148 bits of entropy, a crack-time estimate you can trust, and a clipboard that clears itself after 30 seconds.

Open the toolkit

Part of the Toolly ecosystem · secure.toolly.site