Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
philipsoutham committed Apr 24, 2024
0 parents commit d5575ff
Show file tree
Hide file tree
Showing 23 changed files with 42,956 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dice-phrase
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2024 Philip Southam

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PYTHON := python3
PIP := pip3
TARGET_DIR := dice_phrase
ZIPAPP_NAME := dice-phrase
ENTRY_POINT := dice_phrase.main:app

.PHONY: all install_deps build_zipapp clean

all: install_deps build_zipapp

install_deps:
@echo "Installing dependencies..."
$(PIP) install --upgrade --requirement requirements.txt --target $(TARGET_DIR)

build_zipapp:
@echo "Building the zipapp..."
$(PYTHON) -m zipapp $(TARGET_DIR) -p "/usr/bin/env python3" -m $(ENTRY_POINT) -c -o $(ZIPAPP_NAME)

clean:
@echo "Cleaning up..."
rm -f $(ZIPAPP_NAME)
95 changes: 95 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Dice Phrase

Dice Phrase is a portable and easy-to-install command-line passphrase generator emulates dice rolls to use with a word list to create secure, memorable passphrases. Inspired by the concept of Diceware, Dice Phrase is designed to produce passphrases that are both secure and easy to remember, making it an excellent tool for anyone looking to create easy to use passwords/passphrases.

Frankly, I don't expect anyone but me to use this. I wanted something to use on the CLI so I built it.

## Features

- **Portable**: Comes as a single executable that you can run from anywhere on your system.
- **Customizable**: Supports standard [EFF word lists](https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases) as well as [fandom-based lists](https://www.eff.org/deeplinks/2018/08/dragon-con-diceware) for more personalized passphrases.
- **Secure**: Generates passphrases based on simulated dice rolls to ensure high entropy and security.
- **Easy to Use**: Simple command-line interface that does not require any installation and very little setup.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development, running, and testing purposes.

### Prerequisites

- Python 3.10+
- pip (Python package installer)

### Installing

Dice Phrase is distributed as a Python zipapp. To get started, you can build the zipapp using the provided `Makefile`.

1. Clone the repository:
```bash
git clone https://github.com/philipsoutham/dice-phrase.git
cd dice-phrase
```

2. Build the zipapp:
```bash
make
```

This will create a file named `dice-phrase`, which is an executable zip application. No put it in your `$PATH`, I suggest some place like `~/bin`.

### Usage

To generate a passphrase, simply run the executable with the desired options. To see the options:

```bash
$ dice-phrase --help
```

#### Options

- `--num-passphrases`: The number of passphrases to generate. [default: 1]
- `--num-words`: The number of words to include in the passphrase. We suggest at least a six-word passphrase. [default: 6]
- `--separator`: The separator to use between the words. For whitespace use ' '. [default: -]
- `--include-a-number` OR `--no-include-a-number`: Include a number in the passphrase. [default: include-a-number]
- `--include-a-capital` OR `--no-include-a-capital`: Capitalize one of the words in the passphrase. [default: include-a-capital]
- `--word-list`: Which wordlist to use. [default: large]
- `--colorize` OR `--no-colorize`: Colorize the output. [default: colorize]

### Example(s)

Default options

```bash
$ dice-phrase
Caretaker-geologist56-stooge-unstitch-resonant-brought
```

Using the Harry Potter fandom list

```bash
$ dice-phrase --num-words 7 --word-list harry-potter
stolen-bludger-0kitchens-British-dancing-strikes-hufflepuff
```

<!--
## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
-->

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/philipsoutham/dice-phrase/tags).

## Authors

- **Philip Southam** - *Initial work* - [philipsoutham](https://github.com/philipsoutham)

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Acknowledgments

- Inspired by the [EFF Dice-Generated Passphrase](https://www.eff.org/dice) methodology.
- OpenAI's ChatGPT 4 Turbo helped with the documentation, not the code.
4 changes: 4 additions & 0 deletions dice_phrase/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
!__main__.py
!.gitignore
!/dice_phrase
Empty file.
Binary file added dice_phrase/dice_phrase/eff_large_wordlist.pkl
Binary file not shown.
Loading

0 comments on commit d5575ff

Please sign in to comment.