Skip to content

ASCmx/xkcdpass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

XKCD Password Generator

Creates XKCD-style password based on your parameters.

Fair warning: I'm not a cryptographer or any sort of expert in security. Use at your own risk.

Installation

go get github.com/ASCmx/xkcdpass

Usage

import "github.com/ASCmx/xkcdpass"

config := xkcdpass.Config{
	MinLength: 12,
	MaxLength: 18,
	Language:  "es",
	Separator: ".",
	Numbers:   3,
}

password, err := xkcdpass.Generate(config)

if err != nil {
	log.Printf("Error: %s", err)
}

log.Printf("Password: %s", password)

Notes

xkcdpass will try it's best to give you a password based on your parameters.

  • MinLength: a minimum possible length will be calculated, based on the language file of your choice and an error will be returned if MinLength is less than the shortest word in the file
  • MaxLength: also, if MaxLength is less than the shortest word, an error will be returned (ok, fringe case, but, hey, one tries to be thorough)
  • Language: currently English (en) and Spanish (es) are supported. You can add your own %s_words.txt to static and if you would like to add your language to this repo then send me a PR. These lists have been curated to contain mostly words that are reasonably less common to be used in each language. If you want to compile a list of words for your language, try to find a source that can help you apply the same kind of filter and keep a high number of words
  • Separator: can be any string you want, probably best to keep it to one character, such as a period, dash, space or none (use an empty string or leave it out)
  • Numbers: add an amount of random numbers to the end of word list

Use along with Dropbox's zxcvbn password strength estimator for better, stronger passwords.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages