Generate diceware wordlists.
Project description
diceware-list
Create wordlists for diceware:
$ diceware-list -n -l 7776 /usr/share/dict/words 11111 a 11112 a's ... 12353 capt 12354 cara 12355 carl ... 66663 zoos 66664 éclat 66665 élan 66666 épée
This is not a diceware implementation, but only a helper to create appropriate wordlists.
The main target of diceware-list is to provide “good” wordlists. Wordlists are considered “good” if they
contain enough terms for use with a certain diceware application (for instance 6^6 = 7776 terms if used with six six-sided dice)
contain terms as short as possible (to reduce typing)
(optionally) contain no words with non-ASCII chars (to enable use with non-localized keyboards)
(optionally) are a prefix code, i.e. no complete word in the list is prefix of another word in the list.
contain no offending terms
The last topic is hard to solve technically (hints welcome!), but diceware-list can help to follow the other design rules.
The wordlists generated by diceware-list are not meant to be kept secret. You might put them on the internet, publish on facebook or print them in the New York Times. Instead the security of the diceware technique relies on the entropy or (in this case) “randomness” of your dice, computer, etc.
In other words: Your passphrases will not be safe because of hiding your wordlist. They will be safe because there are so many possible combinations of words you can pick from your wordlist. That means: longer lists are more secure than shorter ones (if really used to full extent by your source of randomness with diceware), but hidden lists are not more secure than public ones.
Install
Install latest release from pypi
(venv) $ pip install diceware-list
or clone repository from github:
$ git clone https://github.com/ulif/diceware-list.git
Please consider using virtualenv for deployment.
In an active virtualenv you can install an executable script of diceware-list running:
(venv) $ python setup.py install (venv) $ diceware-list --help usage: diceware-list [-h] [-l LENGTH] [-n] [--ascii] [-d SIDES] [-k] [--use-416] [-p {none,short,long}] [-v] [--version] DICTFILE [DICTFILE ...]
Usage
First, you need a file with words as “dictionary”. On typical Debian systems such files can be found in /usr/share/dicts/.
This file can then be fed to diceware-list to create a wordlist suitable for use with diceware.:
$ diceware-list /usr/share/dict/words ! !! !!! ... alan alana alar ... zzz zzzz
By default lists of 8192 (=2**13) words are created. This value can be changed with the -l option.
With -n you can tell diceware-list to put numbers into each line, representing dice throws [1]
$ diceware_list -n -l 7776 /usr/share/dict/words 11111 ! 11112 !! ... 12353 alan 12354 alana 12355 alar ... 66665 zzz 66666 zzzz
The –ascii option filters terms out, that contain non-ASCII characters. This can help in generating non-english word lists that are usable with regular english keyboards.
The verbose option –verbose can be given multiple times to increase verbosity.
See –help for other options.
diceware-list follows loosely the recommendations given on http://diceware.com/ by Mr. Reinhold.
Testing
In a clone of the sources you can run tests like this:
(venv) $ python setup.py test
This command will download all required packages, especially py.test.
You can also install py.test manually with pip:
(venv)$ pip install pytest (venv)$ pip install -e .
and afterwards run tests like so:
(venv)$ py.test
If you also install tox:
(venv)$ pip install tox
then you can run all tests for all supported platforms at once:
(venv)$ tox
Coverage
To get a coverage report, you can use the respective tox target:
(venv)$ tox -e cov
Or you use the common coverage tool:
(venv)$ pip install coverage (venv)$ coverage run setup.py test (venv)$ coverage report --include="diceware_list.py,libwordlist.py"
Changes
1.0 (2017-02-09)
The dicewarekit.txt list is not included in generated lists by default from now on. You can request inclusion with new option use-kit. The old option no-kit is not supported any more.
In numbered output, separate digits by - to distinguish numbers with more than one digit. Needed at least when generating wordlists for dice with more than 9 sides.
Rename -s option to -d (as in dice-sides).
Logging output now registered under name libwordlist.
Added new module libwordlist containing the API parts of diceware-list.
New –version option.
New –prefix option. If set prefix code is generated, i.e. lists that contain no item which is prefix of another list item.
Claim support for Python 3.6.
Restructure package: all single scripts are now part of a package.
0.3 (2016-07-25)
Install script as diceware-list instead of diceware_list.
Allow –sides option to support dice that do not have six sides.
0.2 (2016-03-18)
Allow -v option multiple times for increased verbosity.
Pick maximum width terms randomly. Until that change we included all shorter entries and additionally the (alphabetically) first entries of maximum width. Now, we pick a random set of these maximum width entries for the result list.
Claim support for Python 3.5.
0.1 (2016-02-09)
Initial release.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for diceware_list-1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c8fddce4f73b654d4bc686cf8232eeeff6cb71009146191ed8869df59e4871d |
|
MD5 | 546dd18a0ad435e8926bac4bf5439389 |
|
BLAKE2b-256 | dd8b32ef34a369fe479c2ddcc662662bf3fe60845c2b93d08bdae9ab1906c665 |