Crates.io | mkpasswd |
lib.rs | mkpasswd |
version | 0.3.0 |
source | src |
created_at | 2019-03-28 20:21:29.2325 |
updated_at | 2020-04-18 14:05:59.217521 |
description | Library and command-line tool to generate passwords |
homepage | |
repository | https://github.com/Draphar/mkpasswd/ |
max_upload_size | |
id | 124427 |
size | 21,566 |
Using cargo
:
cargo install mkpasswd
You then have access to the mkpasswd
command.
If you simply want a securely generated random password, simply run
mkpasswd
to get a password with special characters and a length of 32 letters.
However, the tool offer more options.
The password length can be set by passing a command line argument like mkpasswd 10
,
which will generate a 10-character password.
If you want to generate multiple passwords, pass --count
or -n
like mkpasswd -n 5
.
You can always pass --help
or -h
to mkpasswd
to retrieve this help.
An alphabet defines the character the password can contain.
The standard alphabet is --password
.
There a few predefined alphabets, which can passed directly:
--password a-z, A-Z, 0-9, each of =+-*/,;:.!?&|^<>(){}_%@#
--latin-numbers a-z, A-Z, 0-9
--base64 a-z, A-Z, 0-9, +, /
--base64-url a-z, A-Z, 0-9, -, _
--numbers 0-9
--latin a-z, A-Z
--latin-lower a-z
--latin-lower-numbers a-z, 0-9
--latin-upper A-Z
--latin-upper-numbers A-Z, 0-9
Another option is passing a string containg all the characters you want after --alphabet
or -a
:
mkpass -a "qwertyQWERTY"