| 1 |
# goxkcdpwgen |
| 2 |
|
| 3 |
xkcd style password generator library and cli tool |
| 4 |
|
| 5 |
## Installation (cli tool) |
| 6 |
|
| 7 |
### Compile |
| 8 |
|
| 9 |
go install -v github.com/martinhoefling/goxkcdpwgen |
| 10 |
|
| 11 |
### Package |
| 12 |
|
| 13 |
no package yet :-) |
| 14 |
|
| 15 |
### Run |
| 16 |
|
| 17 |
All params |
| 18 |
|
| 19 |
$ goxkcdpwgen -h |
| 20 |
Usage of ./goxkcdpwgen: |
| 21 |
-c Capitalize words |
| 22 |
-d string |
| 23 |
Delimiter to separate words (default " ") |
| 24 |
-l string |
| 25 |
Use non english language with custom list, currently only de = german is supported (default "en") |
| 26 |
-n int |
| 27 |
Number of words to generate a password from (default 4) |
| 28 |
-s Use eff_short instead of eff_long as wordlist |
| 29 |
-N count |
| 30 |
Number of passwords to generate |
| 31 |
|
| 32 |
Sample execution |
| 33 |
|
| 34 |
$ goxkcdpwgen -c -d "" -n 5 |
| 35 |
VocalistDurableGauntletBluishReputable |
| 36 |
|
| 37 |
|
| 38 |
## Usage as library |
| 39 |
|
| 40 |
Install dependency |
| 41 |
|
| 42 |
go get github.com/martinhoefling/goxkcdpwgen |
| 43 |
|
| 44 |
Use in code |
| 45 |
|
| 46 |
import ( |
| 47 |
... |
| 48 |
"github.com/martinhoefling/goxkcdpwgen/xkcdpwgen" |
| 49 |
) |
| 50 |
|
| 51 |
|
| 52 |
... |
| 53 |
g := xkcdpwgen.NewGenerator() |
| 54 |
g.SetNumWords(5) |
| 55 |
g.SetCapitalize(true) |
| 56 |
password := g.GeneratePasswordString() |
| 57 |
... |