1
0
mirror of https://github.com/Luzifer/password.git synced 2024-09-18 18:02:56 +00:00
Fast and secure password generator and library
Go to file
2019-01-01 15:28:56 +01:00
alfred-workflow Make generated passwords actionable again 2018-03-21 11:10:13 +01:00
frontend Port application to Bootstrap 4 2019-01-01 14:37:21 +01:00
hasher Implement JSON output with password hashes 2017-10-06 22:54:45 +02:00
js Port application to Bootstrap 4 2019-01-01 14:37:21 +01:00
lib Add XKCD style password generator 2017-10-31 12:10:24 +01:00
vendor Update vendored libraries 2018-12-30 13:51:00 +01:00
.gitignore Port from coffeescript to plain ES6 2018-12-30 12:40:19 +01:00
.gitmodules Rebuilt workflow for better design and auto-update 2017-09-22 17:38:08 +02:00
.repo-runner.yaml Fix: Need to download submodules before packaging 2017-09-22 17:42:13 +02:00
.travis.yml Build on more Go versions 2019-01-01 14:44:25 +01:00
bindata.go Port application to Bootstrap 4 2019-01-01 14:37:21 +01:00
build-workflow.sh Fix: Workflow building broken by zipping artifacts 2018-03-21 11:26:37 +01:00
cmdGet.go Add commandline flag to generate multiple passwords 2017-10-31 12:57:19 +01:00
cmdServe.go Enable gzip compression on assets 2018-12-30 13:49:23 +01:00
cmdVersion.go Fix: Copy&Paste error 2019-01-01 14:01:49 +01:00
Dockerfile Update Dockerfile 2018-12-30 11:26:15 +01:00
flags.go Add commandline flag to generate multiple passwords 2017-10-31 12:57:19 +01:00
generateXKCDWordList.sh Fix: RawGit is closing down, use Github URL 2018-12-30 13:44:08 +01:00
Gopkg.lock Update vendored libraries 2018-12-30 13:51:00 +01:00
Gopkg.toml Update vendored libraries 2018-12-30 13:51:00 +01:00
History.md prepare release v1.12.1 2019-01-01 15:28:56 +01:00
LICENSE Replace Apache license stub with proper license 2017-09-22 15:32:49 +02:00
main.go Add ability to generate XKCD style passwords to tool 2017-10-31 12:24:25 +01:00
Makefile Do not automatically open browser 2019-01-01 14:36:34 +01:00
README.md Update README 2019-01-01 15:21:34 +01:00

Go Report Card

Luzifer / password

The intention of this project is to provide a fast and secure way to generate one or more passwords using a CLI tool, a HTTPs page or a HTTPs API.

For the security of the passwords there are several assertions:

  • The password may not contain pattern found on the keyboard or in alphabet
  • The password must have 3 or 4 different character groups in it depending on whether special characters are requested
  • The password may not have repeating characters
  • The API generator does not transmit or store any data about the generated passwords

Usage

Via Web

My service Secure Password is powered by this app and will provide you with secure passwords.

Via Alfred

(No longer actively maintained as I no longer use OSX / Alfred. The current version stays until it gets reported to be broken and will then get removed.)

  1. Ensure you do have Alfred 3 and have enabled the Powerpack
  2. Download and open the PasswordGenerator.alfredworkflow from Github releases
  3. Let Alfred install the workflow
  4. Generate passwords using pwd 12, with special characters pwd 12 s or XKCD style pwd 4 x

The workflow is set up to automatically check for updates once a day. If you want to check for updates manually open Alfred, enter pwd workflow:update and press enter.

Via CLI

  1. Download the compiled binary from Github releases

  2. Generate your password:

    $ ./password get -h
    generate and return a secure random password
    
    Usage:
      password get [flags]
    
    Flags:
      -d, --date         prepend current date to XKCD style passwords (default true)
      -h, --help         help for get
      -j, --json         return output in JSON format
      -l, --length int   length of the generated password (default 20)
      -n, --number int   number of passwords to generate (default 1)
      -s, --special      use special characters in your password
      -x, --xkcd         use XKCD style password
    
    $ ./password get
    Vzupi4IaPbXmSQEX9A4e
    
    $ ./password get -l 32 -s
    }d.sks(4J$2G]x52=k)WAN{M68LxEg}%
    
    $ ./password get -l 4 -x
    20190101.SeashellSupporterTumbleweedGeneral
    

Via API

  • /v1/getPassword - Retrieve a password from the API
    • date=true - Set to false no to prepend the date to XKCD-style passwords
    • length=20 - Specify the length of the password to generate (the API only supports values between 4 and 128 - for more characters use the CLI)
    • special=false - Set to true to enable special characters
    • xkcd=false - Set to true to enable XKCD-style passwords

Self-Hosted

  1. Download the compiled binary from Github releases

  2. Run the API server:

    $ ./password serve -h
    start an API server to request passwords
    
    Usage:
      password serve [flags]
    
    Flags:
      -h, --help       help for serve
          --port int   port to listen on (default 3000)
    
  3. Request your password using http://localhost:3000/v1/getPassword?length=20&special=true

Hosted

$ curl https://passwd.fyi/v1/getPassword?length=20&special=true
0M4L-1[lT:@2&7,p,o-;

Benchmark / Test

Tests and benchmark are run by Travis CI at every push to this repository:

Build Status

$ go test -bench .
goos: linux
goarch: amd64
pkg: github.com/Luzifer/password/lib
BenchmarkGeneratePasswords8Char-8                  20000             65469 ns/op
BenchmarkGeneratePasswords8CharSpecial-8           20000             97659 ns/op
BenchmarkGeneratePasswords16Char-8                 20000             84215 ns/op
BenchmarkGeneratePasswords16CharSpecial-8          20000             92885 ns/op
BenchmarkGeneratePasswords32Char-8                 10000            152436 ns/op
BenchmarkGeneratePasswords32CharSpecial-8          10000            144352 ns/op
BenchmarkGeneratePasswords128Char-8                 1000           2199011 ns/op
BenchmarkGeneratePasswords128CharSpecial-8          2000           1089225 ns/op
BenchmarkGeneratePasswords4Words-8                200000              9472 ns/op
BenchmarkGeneratePasswords20Words-8               100000             14098 ns/op
PASS
ok      github.com/Luzifer/password/lib 21.624s