Skip to content
/ mempass Public

A memorable password generator, a CLI version of xkpasswd.net written in Go

License

Notifications You must be signed in to change notification settings

eljamo/mempass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mempass

A memorable password generator, a CLI version of xkpasswd.net written in Go. This tool uses libpass to generate passwords

Install

go install github.com/eljamo/mempass@latest

CLI Example Usage

Help

~ $ mempass -h
A memorable password generator, a CLI version of xkpasswd.net written in Go

Usage:
  mempass [flags]

Flags:
      --case_transform string           case transformation, allowed values: ALTERNATE, ALTERNATE_LETTERCASE, CAPITALISE, CAPITALISE_INVERT, INVERT, LOWER, LOWER_VOWEL_UPPER_CONSONANT, NONE, RANDOM, SENTENCE, UPPER (default "RANDOM")
      --custom_config_path string       custom config file path, you can use this to load a custom config. Such as ones generated by xkpasswd.net
  -h, --help                            help for mempass
      --num_passwords int               number of passwords to generate, valid values: 1+ (default 3)
      --num_words int                   number of words, valid values: 2+ (default 3)
      --pad_to_length int               length to pad the password to, will be ignored if less than the generated password length, valid values: 0+
      --padding_character string        character to pad the password with, example values: RANDOM, !, @, $, %, ^, &, *, -, +, =, :, |, ~, ?, /, ., ; (default "RANDOM")
      --padding_characters_after int    number of characters to pad before the password, valid values: 0+ (default 2)
      --padding_characters_before int   number of characters to pad before the password, valid values: 0+ (default 2)
      --padding_digits_after int        number of digits to pad before the password, valid values: 0+ (default 2)
      --padding_digits_before int       number of digits to pad before the password, valid values: 0+ (default 2)
      --padding_type string             padding type, allowed values: ADAPTIVE, FIXED, NONE (default "FIXED")
      --preset string                   use a built-in preset. Valid values: DEFAULT, APPLEID, NTLM, SECURITYQ, WEB16, WEB16_XKPASSWD, WEB32, WIFI, XKCD, XKCD_XKPASSWD (default "DEFAULT")
      --separator_alphabet strings      comma-separated list of characters to separate password parts, example values: !, @, $, %, ^, &, *, -, +, =, :, |, ~, ?, /, ., ;
      --separator_character string      character to separate password parts, example values: RANDOM, !, @, $, %, ^, &, *, -, +, =, :, |, ~, ?, /, ., ; (default "RANDOM")
      --symbol_alphabet strings         comma-separated list of characters to pad the password with, example values: !, @, $, %, ^, &, *, -, +, =, :, |, ~, ?, /, ., ;
  -v, --version                         version for mempass
      --word_length_max int             maximum word length, valid values: 1+ (default 8)
      --word_length_min int             minimum word length, valid values: 1+ (default 4)
      --word_list string                use a built-in list of words. Valid values: ALL, DOCTOR_WHO, EN, EN_SMALL, GAME_OF_THRONES, HARRY_POTTER, MIDDLE_EARTH, STAR_TREK, STAR_WARS (default "EN")

Using the built-in default preset

~ $ mempass
**46=walter=agents=doctrine=65**
;;57.WILDLIFE.aspect.HYBRID.41;;
..51!INQUIRY!WINSTON!singer!26..

Using a custom config generated on xkpasswd.net

~ $ mempass --custom_config_path ./config_generated_from_xkpasswd.net.json
freedom-SUBARU-POSTCARD-MATCH-67;
warriors-CASTING-ROSTER-RELEVANT-04&
REFINED-triumph-WEST-MARVEL-03$

Using the built-in XKCD preset

~ $ mempass --preset XKCD
ROSE-EPINIONS-SPEEDS-putting-76_
enabled-pleasure-convert-poor-61_
caring-COUNSEL-DISH-spectrum-31|

Using the built-in XKCD preset to generate 10 passwords

~ $ mempass --preset XKCD --num_passwords 10
MASON-mailman-velvet-came-07_
CLOSURE-COLOUR-sons-mart-97~
JUNGLE-DRUM-HOURLY-ANAHEIM-84.
MOMS-plasma-tackle-UNIX-21+
YOUNG-PARK-took-babes-69!
backed-burden-SURVIVE-EMPIRE-48-
RECOVER-WIFI-feeding-tigers-84+
deliver-nicholas-flower-JULIAN-94_
wires-neon-MSGID-evil-88_
winners-tion-provider-BEVERLY-62$

Using the built-in XKCD preset to generate passwords with 10 words in them

~ $ mempass --preset XKCD --num_words 10
retailer-pools-COMMENT-GLASS-programs-STANDS-offense-CONSIDER-business-bald-50+
GRAY-jury-special-FORMER-helping-ALGERIA-networks-precise-quoted-ELECTRO-53_
WALKING-advanced-MUSLIM-review-KNOW-hughes-spas-PHYS-FARM-GOSSIP-12=

Using the built-in XKCD preset to generate passwords using the Middle Earth word list

~ $ mempass --preset XKCD --word_list MIDDLE_EARTH
LEGOLAS-SPEAKS-clinking-anigh-79%
CAIRN-CLOSED-CLOUD-TOMB-70@
thudding-spotted-legends-TEMPERS-99?

Using the built-in WEB32 preset to generate passwords and pad them to length of 32 characters

~ $ mempass --preset WEB32 --padding_type ADAPTIVE --pad_to_length 32
51,tions,PAINT,bush,NONE,18!!!!!
52_mill_BRAS_talks_DONNA_93|||||
07,costa,DANCE,shine,BLINK,37:::

Development

Run locally after git clone

~/c/g/mempass $ go run .
--28-chrome-dream-clocks-28--
==63@DIVIDE@glossary@tough@36==
$$53?LOTTERY?HAVE?HOTMAIL?81$$

Build & Run

~/c/g/mempass $ go build -o ./bin/mempass ./main.go && ./bin/mempass
__43:RATIOS:jobs:baghdad:37__
;;87=struggle=rich=think=08;;
..25~ESCORTS~scene~NOTICED~62..