面对Python的BCRypt模块

发布于 2025-02-12 07:35:05 字数 480 浏览 0 评论 0原文

这是为我的学校项目。 我在Python中使用bcrypt进行了一个函数来加密函数。现在加密很好,我可以存储它。但是,它在检查哈希代码时显示出错误。

    def decrypt(password, hashed):
        password=password.encode('utf-8')
        return bcrypt.checkpw(password, hashed)

这是功能。在这里,“密码”是用户的输入,我正在从数据库中调用的“ hashed”变量。

这是我得到的错误

”“

我该怎么办?

This is for my school project.
I made a function to encrypt functions using bcrypt in python. Now the encryption is fine and I can store it. But it shows error while checking the hashed code.

    def decrypt(password, hashed):
        password=password.encode('utf-8')
        return bcrypt.checkpw(password, hashed)

This is the function. Here the 'password' is the input by user and 'hashed' variable I am calling from the database.

This is the error I am getting

what do I do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文