https://github.com/schultz-is/passgen
Password and passphrase generation utility.
https://github.com/schultz-is/passgen
command-line command-line-tool go-tool passphrase passphrase-generator password password-generator
Last synced: 5 months ago
JSON representation
Password and passphrase generation utility.
- Host: GitHub
- URL: https://github.com/schultz-is/passgen
- Owner: schultz-is
- License: isc
- Created: 2020-07-12T21:25:49.000Z (almost 6 years ago)
- Default Branch: trunk
- Last Pushed: 2025-11-16T04:38:21.000Z (7 months ago)
- Last Synced: 2025-12-01T08:23:59.914Z (6 months ago)
- Topics: command-line, command-line-tool, go-tool, passphrase, passphrase-generator, password, password-generator
- Language: Go
- Homepage: https://passgen.is
- Size: 970 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# passgen

[](https://goreportcard.com/report/github.com/schultz-is/passgen)
[](https://pkg.go.dev/github.com/schultz-is/passgen)
[](./LICENSE)
`passgen` is an API and command-line utility for generating passwords and passphrases.
## Installation
To install the command-line utility:
```console
git clone -b stable --depth 1 https://github.com/schultz-is/passgen.git
cd passgen
make install
```
To install the API for use in other projects:
```console
go get github.com/schultz-is/passgen
```
## Examples
### Using the command-line utility
```console
> passgen password
vt7tStRf3SfLV3V3
```
```console
> passgen pw -alnsu
Bc!Eyca9pHmWuRJr
```
```console
> passgen pw 5 10 --alphabet "ACGT"
ATAAG
CATTC
TTGAT
CGGAT
TGTAG
GCGAC
ACATG
TTATT
ACTAT
CCGTA
```
```console
> passgen passphrase
faceless navigate scabby return snorkel cough
```
```console
> passgen pp -ts.
Cranberry.Deskwork.Ramble.Energize.Gloss.Tranquil
```
```console
> passgen pp 5 6 -uw words.txt
TANNING TRICKLE PRECOOK KEEP ARMHOLE
MARITIME LADYLIKE ELM UNDRAFTED BONANZA
EGOTISM MANTIS BANNER MUNICIPAL AMUSING
EVOLUTION WIRING TRACK BLURT GREYHOUND
UNTITLED RURAL SHAKINESS GEOMETRIC ARMREST
WHY OUTCLASS RIVETING OVERLORD UNFIXED
```
### Using the API
```go
package main
import (
"fmt"
"github.com/schultz-is/passgen"
)
func main() {
passwords, err := passgen.GeneratePasswords(
passgen.PasswordCountDefault,
passgen.PasswordLengthDefault,
passgen.AlphabetDefault,
)
if err != nil {
panic(err)
}
for _, password := range passwords {
fmt.Println(password)
}
}
```
[Open in Go Playground](https://play.golang.org/p/H45Sord6t0v)
```go
package main
import (
"fmt"
"github.com/schultz-is/passgen"
)
func main() {
passphrases, err := passgen.GeneratePassphrases(
passgen.PassphraseCountDefault,
passgen.PassphraseWordCountDefault,
passgen.PassphraseSeparatorDefault,
passgen.PassphraseCasingDefault,
passgen.WordListDefault,
)
if err != nil {
panic(err)
}
for _, passphrase := range passphrases {
fmt.Println(passphrase)
}
}
```
[Open in Go Playground](https://play.golang.org/p/I-t1GM0QjUy)
## Tests
```console
> make test
> make cover
```
## Benchmarks
```console
> make benchmark
> go tool pprof prof/cpu.prof
> go tool pprof prof/mem.prof
```
## Build
```console
> make build
> ./dist/passgen --version
```