我想让一个客户给我发送一个签名,我可以“取消签名”我发现了一个用Python编写的很酷的包itsdangerous它可以做我需要的一切。。。在
>>> from itsdangerous import Signer
>>> s = Signer('secret-key')
>>> s.sign('Things you and me should only know')
'my string.wh6tMHxLgJqB6oY1uT73iMlyrOA'
>>> s.unsign('my string.wh6tMHxLgJqB6oY1uT73iMlyrOA')
'my string'
它工作得很好,但是我的客户机没有使用Python,所以他们如何对字符串进行签名,也就是说,它的危险之处在于如何散列客户机需要重新创建的陷阱。在
来自their documentation
然后进行哈希运算(emphasis mine)
因此,假设您只进行散列,而不在之后加盐,他们可以用SHA-1散列来重现这个结果。在
相关问题 更多 >
编程相关推荐