password - generate cryptographically secure passwords
password [--length <int>] [--special|--no-special]
[--version] [--help]
-
--length <int>
how long you want the password (defaults to 12)
-
--special | --no-special
should there be special characters in the password
-
--version
print the version and exit
-
--help
print this dialogue
password
generates cryptographically secure random passwords using alphanumeric characters with case variation and optional special characters.
password
can be used as a script or as a perl module.
To install password
as a script.
-
Generate the build and install tooling
perl Makefile.PL
-
Build, test, and install
make make test && make install
-
Get a 12 character length password
password
-
Get a 32 character length password
password --length 32
-
Get a 32 character length password with special characters
password --length 32 --special
-
Get a 12 character length password
require 'password'; my $object = password->new( length => 12 ); my $password = $object->generate();
-
Get a 32 character length password
require 'password'; my $object = password->new( length => 32 ); my $password = $object->generate();
-
Get a 32 character length password with special characters
require 'password'; my $object = password->new( length => 32, special => 1 ); my $password = $object->generate();
Constructor for the password object.
-
length
The length of the password to be generated. Must be a positive integer.
The password object.
-
length must be a positive integer
This exception is thrown when verification of the length argument doesn't pass.
Generates the password based on the length as defined through the constructor.
None.
The generated password string.
The following exit statuses are returned when run as a script.
- 0 - Indicates completion without failure
- 1 - Indicates failure
Blaine Motsinger, blaine@renderorange.com
This software is available under the MIT license.
Copyright (c) 2022 Blaine Motsinger