Pgen / Go (secure)

Source ยป

Generate cryptographically secure random passwords using "crypto/rand".

pgen.go

$ pgen -h
Pgen generates cryptographically secure strings.

Usage:

	pgen [arguments] length

Notes:

	Default length is 16. Default character set is '-A'.

The arguments are:

  -A	use all character sets (lower, numeric, special, upper).
  -B	generate an array of bytes and print as raw string of bits.
  -L	generate lowercase letters.
  -N	generate lowercase letters.
  -S	generate lowercase letters.
  -U	generate lowercase letters.
  -b	generate an array of bytes.
  -p	print character sets and exit.
  -z	allow zero-length passwords, exiting with success.

Example

$ pgen
hXEGr?>9[$u~Y>el
$ pgen -L -N -U 8
Y7D2QgCa
$ pgen -B 16
01011111101000011111111010010011100110011110011101100001111100100000011010110011100110101001101011100101001000110110110000101010