Skip to content

🎲 Python-based secure passphrase generator using the Diceware method - CLI tool with multi-language support

Notifications You must be signed in to change notification settings

th-hoffmann/DicewarePy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ver esta pΓ‘gina em PortuguΓͺs

DicewarePy

Python License

A simple and secure passphrase generator based on the Dicewareβ„’ method created by Arnold G. Reinhold.

🎲 What is Diceware?

Diceware is a method for creating passphrases, passwords, and other cryptographic variables using an ordinary dice as a source of randomness. This method ensures that your passphrases are truly random and secure against various types of attacks.

For more information about the original Dicewareβ„’ method, visit: https://www.diceware.com/

✨ Features

  • 🌍 Multi-language support: English and Spanish wordlists included
  • 🎯 True randomness: Uses secure random number generation
  • πŸ“ 7,776 words per language: Complete standard Diceware wordlists
  • πŸ–₯️ Simple CLI interface: Easy-to-use command-line interface
  • πŸ”’ Secure: No internet connection required, runs completely offline

πŸš€ Quick Start

Prerequisites

  • Python 3.6 or higher

Installation

  1. Clone this repository:
git clone https://github.com/th-hoffmann/DicewarePy.git
cd DicewarePy
  1. Run the script:
python3 Diceware.py

Usage

  1. Run the program:

    python3 Diceware.py
  2. Select your language:

    • 1 for English
    • 2 for EspaΓ±ol (Spanish)
    • 0 to Exit
  3. Choose the number of words for your passphrase (recommended: 6-8 words)

  4. Your secure passphrase will be generated!

πŸ“– Example

$ python3 Diceware.py

    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—    β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—
    β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘    β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•
    β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘ β–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• 
    β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•”β•β•β•β•   β•šβ–ˆβ–ˆβ•”β•  
    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘        β–ˆβ–ˆβ•‘   
    β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β•β•β•β•β•β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•šβ•β•β• β•šβ•β•  β•šβ•β•β•šβ•β•  β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β•        β•šβ•β•   

                        Diceware Passphrase Generator

    1. English
    2. EspaΓ±ol
    0. Exit

Select the language: 1
Enter the number of words for your password: 6

51234 -> horse
41356 -> battery
23145 -> staple
61432 -> correct
15234 -> amount
34512 -> system

πŸ” Security Considerations

  • Use 6-8 words for strong security (recommended by security experts)
  • Each additional word exponentially increases security
  • Don't reuse passphrases across different accounts
  • Store securely using a password manager when possible

Passphrase Strength

Words Possible Combinations Equivalent Random Password
4 ~3.6 Γ— 10¹⁡ ~51 bits
5 ~2.8 Γ— 10¹⁹ ~64 bits
6 ~2.2 Γ— 10Β²Β³ ~77 bits
7 ~1.7 Γ— 10²⁷ ~90 bits
8 ~1.3 Γ— 10Β³ΒΉ ~103 bits

πŸ“ Project Structure

DicewarePy/
β”œβ”€β”€ Diceware.py      # Main application
β”œβ”€β”€ english.txt      # English wordlist (7,776 words)
β”œβ”€β”€ spanish.txt      # Spanish wordlist (7,776 words)
└── README.md        # This file

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Adding New Languages

To add support for a new language:

  1. Create a new wordlist file with 7,776 words (following Diceware format)
  2. Add the language option to the main menu
  3. Create a new function following the existing pattern
  4. Update this README

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Arnold G. Reinhold for creating the original Dicewareβ„’ method
  • The Electronic Frontier Foundation (EFF) for promoting secure password practices
  • The open-source community for various improvements and suggestions

πŸ“š References


Note: Dicewareβ„’ is a trademark of Arnold G. Reinhold. This implementation is not affiliated with or endorsed by the original creator.