带有cli实用程序的安全密码生成器

passgenerator的Python项目详细描述


密码生成器

PythonBuild StatusIssuesLicense

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 the generate 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

许可证

这个项目是根据麻省理工学院的许可证授权的

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
ArrayList Scanner UserInput的Java ArrayList   java ILOG TSP获取空输出   服务器Java Http客户端没有此类字段错误   java ContextMenu在managedbean中不调用delete   java Getting submit按钮用于recyclerview适配器和主活动中的edittext   java JavaFX ListView selectedItemProperty未在clearSelection(索引)时触发   如何使用Spring和Java从LDAP获取userPassword属性   java Autowired不适用于非spring Singleton   rhel Red Hat Linux Enterprise 5.7删除Java   java com。谷歌。应用程序编程接口。客户扩展。安卓http。安卓http已被弃用   Java列表集方法   java在一个集合中监听多个文档,并更新recyclerview   java decodeByteArray返回null   java如何更改dconf目录?   Spring中RestTemplate中的java unicode转换   java帮助实现树递归   java如何在libGDX中测量触摸压力