python-3.x - 有谁知道如何在python中制作加密密码系统?
问题描述
我可以制作一个可以写入文件的文件,但我需要制作一个加密的文件,而不介意它使用什么模块。
解决方案
你可以使用werkzeug
.
from werkzeug.security import generate_password_hash, check_password_hash
secure_password = generate_password_hash('super-secret-password')
assert(check_password_hash(secure_password, 'super-secret-password'))
推荐阅读
- c# - X509Certificate 中的公钥和私钥
- java - 如何在这里摆脱硬编码值?
- javascript - 如果单击了某个项目(并且之前已将其添加到数组中),如何从数组中删除它?
- python - 散景:如何通过 box_select 编辑 df 或 CDS 对象?
- nginx - 重写规则而不改变 Nginx 中的 uri
- angular - 带有queryParams的Angular jasmine toHaveBeenCalledWith不起作用
- shopware - Shopware6:密钥路径“.../config/jwt/public.pem”权限错误
- python - 如何在python中比较两个图像文件的内容?
- reactjs - 使用诸如“输入”之类的按键添加新行
- django - 如何使 Django FormSet 接受 m2m 但将它们存储为多个 FK 记录?