1
0
mirror of https://github.com/Luzifer/password.git synced 2024-09-19 18:32:57 +00:00
password/README.md

90 lines
2.8 KiB
Markdown
Raw Normal View History

[![Go Report Card](https://goreportcard.com/badge/github.com/Luzifer/password)](https://goreportcard.com/report/github.com/Luzifer/password)
![](https://badges.fyi/github/license/Luzifer/password)
![](https://badges.fyi/github/downloads/Luzifer/password)
![](https://badges.fyi/github/latest-release/Luzifer/password)
2015-05-02 13:42:41 +00:00
# Luzifer / password
2015-05-10 18:11:31 +00:00
This project is a rewrite of my former password generator written in Python. The intention 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.
2015-05-02 13:42:41 +00:00
## Usage
### Via Web
2015-05-10 18:11:31 +00:00
My service [Secure Password](https://pwd.luzifer.io/) is powered by this app and will provide you with secure passwords.
2015-05-02 13:42:41 +00:00
### Via CLI
1. Download the compiled binary from [Github releases](https://github.com/Luzifer/password/releases/latest)
2015-05-02 13:42:41 +00:00
2. Generate your password:
```bash
# ./password get -h
NAME:
get - generate and return a secure random password
USAGE:
command get [command options] [arguments...]
OPTIONS:
--length, -l "20" length of the generated password
--special, -s use special characters in your password
# ./password get
Vzupi4IaPbXmSQEX9A4e
2015-05-02 14:02:19 +00:00
# ./password get -l 32 -s
}d.sks(4J$2G]x52=k)WAN{M68LxEg}%
2015-05-02 13:42:41 +00:00
```
### Via API
2015-05-02 14:02:19 +00:00
- `/v1/getPassword` - Retrieve a password from the API
- `length=20` - Specify the length of the password to generate
- `special=false` - Set to `true` to enable special characters
#### Self-Hosted
1. Download the compiled binary from [Github releases](https://github.com/Luzifer/password/releases/latest)
2015-05-02 14:02:19 +00:00
2. Run the API server:
```bash
# ./password serve -h
NAME:
serve - start an API server to request passwords
USAGE:
command serve [command options] [arguments...]
OPTIONS:
--port "3000" port to listen on
```
3. Request your password using `http://localhost:3000/v1/getPassword?length=20&special=true`
#### Hosted
```bash
# curl https://pwd.luzifer.io/v1/getPassword?length=20&special=true
2015-05-02 14:02:19 +00:00
0M4L-1[lT:@2&7,p,o-;
```
2015-05-02 13:42:41 +00:00
## Benchmark / Test
Tests and benchmark are run by Travis CI at every push to this repository:
[![Build Status](https://travis-ci.org/Luzifer/password.svg)](https://travis-ci.org/Luzifer/password)
```bash
# go test -bench .
PASS
BenchmarkGeneratePasswords8Char 20000 74875 ns/op
BenchmarkGeneratePasswords8CharSpecial 10000 108451 ns/op
BenchmarkGeneratePasswords16Char 10000 135059 ns/op
BenchmarkGeneratePasswords16CharSpecial 10000 142958 ns/op
BenchmarkGeneratePasswords32Char 5000 307994 ns/op
BenchmarkGeneratePasswords32CharSpecial 5000 284031 ns/op
BenchmarkGeneratePasswords128Char 300 6721034 ns/op
BenchmarkGeneratePasswords128CharSpecial 500 3244446 ns/op
ok github.com/Luzifer/password/lib 13.764s
```