anna-hope / password-generator

A small CLI passphrase generator that uses Diceware™ wordlist, written in Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

password generator

A CLI passphrase generator that builds a passphrase by simulating dice throws and using them to pick components of that passphrase from the Diceware™ wordlist.

The resulting passphrases are cryptographically strong, but easier to remember than regular random-character passwords.

Sample output:

Your passphrase is: ping-paper-edwin-boil-gator-spooky
Copied to clipboard! ✅

Motivation

This is a small project mostly for me to learn Rust. However, if you find it useful, you can install it using the steps below.

Installation

git clone git@github.com:anna-hope/password-generator.git
cd passsword-generator
cargo install --path .

Additional usage options

Some websites require your password to include digits, special characters, or a mix of lowercase and capital letters. You can generate a passphrase that satisfies all of those requirements like this (assuming you've installed the program as described above):

password_generator -s digit -a -c

However, the resulting password will likely be much harder to remember, for example Mv7Town1Ohmic6Sis0'1Kt3^3"6Spurn.

You can see all the available options by running

password_generator --help

How does this work and is it actually secure?

The Diceware FAQ provides a lot of good background information about the algorithm and logic behind this program. I would recommend reading it if you're interested in more information about security, entropy, adequate password length for different scenarios, and more.

The Diceware FAQ recommends using physical dice instead of a computer

That's true.

This program simulates dice throws by using the StdRng in Rust's rand crate, which uses a cryptographically secure algorithm to generate random numbers. The resulting passphrases generated by this program should be strong enough for most applications.

However, if you want to have more certainty in your generated passphrase, please do use physical dice and follow the Diceware instructions manually.

About

A small CLI passphrase generator that uses Diceware™ wordlist, written in Rust.


Languages

Language:Rust 100.0%