带有cli实用程序的安全密码生成器
passgenerator的Python项目详细描述
密码生成器
PassGenerator
是一个带有cli实用程序的安全密码生成器。它可以生成随机的复杂密码或同源密码。
目录
先决条件
您需要安装python才能运行PassGenerator
。首先下载并安装Python。
Note: Python 3 is recommended, however
PassGenerator
has been successfully tested with Python 2.6+
安装
pip install passgenerator
用法
PassGenerator
提供以下方法:
passgenerator.generate(length=32, upper=True, lower=True, numbers=True, special=True)
passgenerator.complexpass(length=32, upper=True, lower=True, numbers=True, special=True)
passgenerator.phoenetic(number_words=4, word_list='path/to/list')
*Note: The
complexpass
method calls thegenerate
method - both methods provide identical output
示例代码:
>>> import passgenerator
>>> passgenerator.generate()
'qq*6opDb45;o~;6jWy4U-A5V.*cbHp1Z'
>>> passgenerator.generate(14, numbers=False)
"N'VJXGQ'Sj)Cj-"
>>> passgenerator.phoenetic()
('calliper delaying shrunken crednerite', 'calliperdelayingshrunkencrednerite')
>>> passgenerator.phoenetic(3)
('nonsensitization psittacinite floruits', 'nonsensitizationpsittacinitefloruits')
命令行实用程序
PassGenerator
包含用于生成密码的命令行实用程序。
passgenerator --help
usage: passgenerator.py [-h] [-l] [-L] [-n] [-N] [-p] [-s] [-S] [-u] [-U]
[-w <word list>]
[length]
Generates secure random passwords
positional arguments:
length length of password (default is 32 characters for
complex and 4 words for phoenetic)
optional arguments:
-h, --help show this help message and exit
-l, --lower-enable use lower case characters
-L, --lower-disable don't use lower case characters
-n, --number-enable use number characters
-N, --number-disable don't use number characters
-p, --phoenetic create phoenetic password using English words
-s, --special-enable use special characters
-S, --special-disable
don't use special characters
-u, --upper-enable use upper case characters
-U, --upper-disable don't use upper case characters
-w <word list>, --word-list <word list>
use provided word list (plaintext format, return
seperated
optional argument '-w/--word-list' assumes '-p/--phoenetic'
生成默认复杂密码:
passgenerator
zT0Q9tyfcAx.S2d8*pXGxen86ipSL_;E
生成无特殊字符的14字符复杂密码:
passgenerator -S 14
pocUvtR0RyZ9jd
生成phoenetic密码
passgenerator -p
taurocol pandiabolism alkalinuria enfeeblish
taurocolpandiabolismalkalinuriaenfeeblish
使用3个字生成phoenetic密码
passgenerator -p 3
overdevotedly evanesces perceivers
overdevotedlyevanescesperceivers
许可证
这个项目是根据麻省理工学院的许可证授权的