This utility generates passwords according to a given template and supports a CLI interface. It can work in PIPE and supports logging for detailed processing information (-vvv
).
- Random Method:
- Generates a password of a specified length from a set of characters.
- Pattern-Based Generation:
- Generates passwords that follow specific rules or conditions.
- Define the character set directly in the command line argument.
- Optionally add commonly used character ranges.
- Manually specify characters using the
\S
option.
- All Unicode characters in the ranges [U+0001, U+D7FF] and [U+E000, U+FFFF] are supported, except { U+0009 / '\t', U+000A / '\n', U+000D / '\r' }.
- Characters in the range [U+010000, U+10FFFF] are not supported.
Create passwords using the following placeholders:
Placeholder | Type | Character Set |
---|---|---|
d |
Digit | 0123456789 |
l |
Lower-Case Letter | abcdefghijklmnopqrstuvwxyz |
L |
Mixed-Case Letter | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz |
u |
Upper-Case Letter | ABCDEFGHIJKLMNOPQRSTUVWXYZ |
p |
Punctuation | ,.;: |
\ |
Escape | Use following character as is |
{n} |
Repeat | Repeat the previous placeholder n times |
[...] |
Custom Char Set | Define a custom character set |
dddd
generates passwords like:41922
,12733
,43960
,07660
,12390
,74680
, ...u{4}d{3}\-l{2}
generates passwords like:DHRF345-st
,FHGFds4-vt
,DERS774-sd
-n
: Set length of password and generate a random password from the set {small letter ASCII, big letter ASCII, digit}-t
: Set template for generating passwords-f
: Get a list of patterns from a file and generate random passwords for each-c
: Specify the number of passwords to generate-vvv
: Enable verbose mode (-v
,-vv
,-vvv
)-h
: Display help information-S
: Define character set
- The output can be redirected using pipe.
-
Command Line Interface:
- argparse module — Parser for command-line options, arguments, and sub-commands
- How to Build Command Line Interfaces in Python With argparse
-
Logging in Python: