Menu

dk-pwgen manual

Dirk Krause
← Previous ↑ Home → Next

dk-pwgen — Generate password, PINs, and WiFi Keys

Synopsis

dk-pwgen [_options_]

Description

The program generates random passwords, PINs and hexadecimal keys (i.e. for WiFi).

Normal user password
This is the default output type. Specify a range (or just a value) for password length, number of uppercase characters in the password, number of digits in the password and number of special characters in the password. The minimum password length must be at least the summary of uppercase, digits and special character maximum.

Hard password
Use -h to switch to hard passwords and specify the length (either value or range).
Characters are choosen in the range 0x33 ("!") to 0x7A ("z").

Binary random data
Use -b to create binary random data instead of text output and specify the length (either value or range).
Not available on Windows, use [dk-rand] instead.

PIN number
Use -p to switch to PIN numbers and specify the length (either value or range).

Hexadecimal key
Use -x or -X to switch to hexadecimal keys and specify the length (either value or range).

This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org/)
This product includes cryptographic software written by Eric Young (eay@cryptsoft.com).
This product includes software written by Tim Hudson (tjh@cryptsoft.com).


Options

Option Purpose
-h
--hard
Create hard password. The options -h, -b, -x, -X and -p are mutually exclusive.
-b
--binary
Create binary random data (not available on Windows systems, use the dk-rand program instead). The options -h, -b, -x, -X and -p are mutually exclusive.
-x
--hex
Create hexadecimal key using lower case characters "a" to "f".
-X
--Hex
Create hexadecimal key using upper case characters "A" to "F".
-p
--pin
Create PIN (personal identification number).
-l range
--length=range
Output length, either specify one number for an exact length or two numbers (minimum and maximum) separated by minus.
-u range
‑‑upper‑case=range
Number of upper case characters in a normal user password.
-d range
--digits=range
Number of digits in a normal user password.
-s range
--special=range
Number of special characters in a normal user password.
-n
--no-newline
Suppress the newline at end of output.
--verbose Show error message upon interrupt by SIGPIPE.

For normal user passwords the summary of maximum values for upper case characters, digits, and special characters must not exceed the minimum length.


Exit status

0 on success, all other status codes indicate an error.


Environment

Environment variable name Purpose
EGDSOCKET Path to EGD socket to obtain seed data from the entropy gathering daemon (EGD).

Files

File name Used for
/dev/random Preferred entropy source on non-Windows systems.
/dev/urandom Alternative entropy source on non-Windows systems.

Restrictions

The -b option is not available on Windows systems.
Use the dk-rand program instead.


Notes

This program uses DK libraries version 4.


Examples

Create user password

To create a password, 8 to 10 characters long containg 1 to 3 uppercase characters, 1 to 2 digits and 1 to 2 special characters:

dk-pwgen -l 8-10 -u 1-3 -d 1-2 -s 1-2
Option Purpose
-l 8-10 Entire password is 8 to 10 character positions long.
-u 1-3 1 to 3 characters are upper case.
-d 1-2 1 to 2 digits in the password.
-s 1-2 1 to 2 special characters in the password.

Create harder password

To create a harder password, 8 to 10 characters long mixing upper case characters, lower case characters, digits and special characters at random:

dk-pwgen -h -l 8-10
Option Purpose
-l 8-10 Entire password is 8 to 10 character positions long.
-h Hard password, Upper case and lower case characters, digits and special characters mixed at random.

Create numeric PIN

To create a numeric PIN of 6 digits:

dk-pwgen -p -l 6
Option Purpose
-l 6 Output is 6 character positions long.
-p Create PIN consisting of digits only.

Create hexadecimal key

To create a WiFi key of 60 hexadecimal digits:

dk-pwgen -x -l 60
Option Purpose
-l 60 Output is 60 character positions long.
-x Output consists of hexadezimal digits only.

This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/).
This product includes cryptographic software written by Eric Young (eay@cryptsoft.com).
This product includes software written by Tim Hudson (tjh@cryptsoft.com).


← Previous ↑ Home → Next

Related

Wiki: dk-pwgen
Wiki: dk-rand