manage.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:freeradius 作者: epiphyte 项目源码 文件源码
def gen_pass(dump, key):
    """Generate password for a user account."""
    if key is None:
        print("no key available")
        exit(1)
    rands = ''.join(random.choice(CHARS) for _ in range(64))
    encoded = wrapper.encrypt(rands, key)
    raw = wrapper.decrypt(encoded, key)
    if rands != raw:
        print("encrypt/decrypt problem")
        exit(1)
    if dump:
        print("password:")
        print(raw)
        print("config file encoded")
        print(encoded)
    else:
        return (raw, encoded)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号