This project is clojure version of Diceware Password Generator I have written some time ago (in Rust).
The aim is to create an application that could be used to generate easy to remember passwords using the Diceware™ method.
dpgclj options:
-l:[language] - generate password using specified language. By default only pl (Polish) and en (English) are supported. Dpgclj tries to read all files matching diceware-XY.txt pattern where XY is code for the language (pl, en, es, etc.) - so it is pretty easy to use this app to generate password in any language providing only proper list of words.
-w:[number] - generate password(s) containing specified number of words.
-s:[char] - separate words using provided separator - default is - (dash).
-p:[number] - number of passwords to be generated at once - default is 1.
Please note: order of options does NOT matter.
For the sake of simplicity only -l and -w are required.
-w:5 -l:en - generates password from English diceware list, consisting of 5 words. Words will be separated by -.
-w:4 -l:pl -s:. - generates single password from Polish diceware list, consisting of 4 words, words will be separated by .
-l:fi -w:8 -p:6 - generates 6 passwords from Finnish diceware list, each password consisting of 8 words, words separated by -.
-p:10 -l:pt -p:100 -s:/ -w:7 - generates 10 passwords from Portugese diceware list, each password consisting of 7 words, each word separated by /
Dpgclj has been created using leiningen - lein becomes the first requirement - install it before proceeding with any further steps.
To test dpgclj, or some of its functions, type lein repl.
dpgclj could be run in very simple way: lein run. Parameters could also be added.
-
lein uberarresults in building complete jar -
java -jar target/uberjar/dpgclj-0.1.0-SNAPSHOT-standalone.jar. All options could be passed after the name of the jar file to be executed.
Dpgclj contains some unit tests, and by default Travis-Ci is used to run tests against each and every commit (or rather push) to the github repository.
It is also possible to run test locally using lein: lein test. This method has one disadvantage - it takes significant time to startup lein itself, so it often takes ~4-5 seconds (or even more) to get info on failing/passing tests.
It is also possible to run tests within Clojure repl, as follows:
- Run repl (
lein replfrom withing the folder into whichdpgcljwas cloned) - Load Clojure testing namespace:
(use 'clojure.test) - Load namespaces containing tests:
(use 'dpgclj.crypt-test)and(use 'dpgclj.options-test) - Run tests
(run-all-tests)- run tests from all namespaces loaded(run-tests 'dpgclj.options-test)- run test from single namespace(run-tests 'dpgclj.options-test 'dpgclj.crypto-test)- run tests from all (explicitly) specified namespaces
If you're using Emacs/Spacemacs with Cider plugin (don't know about other editors/IDE) it is also possible to conveniently run tests from the editor itself.
Diceware is a trademark of A G Reinhold. More info: http://world.std.com/~reinhold/diceware.html
English diceware list taken from: https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases ' Polish diceware list has been created by me: https://github.com/MaciekTalaska/diceware-pl
Additional lists could be found on Mathiaz Gumm'z repository: https://github.com/mgumz/diceware/tree/master/lists
Copyright © 2018 Maciek Talaska
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.