python hmac解密

mac2022-06-30  28

import hmac def get_singa_true(timestamp): sha1 = hmac.new("d1b964811afb40118a12068ff74a12f4".encode('utf8'), digestmod='sha1') sha1.update("password".encode('utf8')) sha1.update("c3cef7c66a1843f8b3a9e6a1e3160e20".encode('utf8')) sha1.update("com.zhihu.web".encode('utf8')) sha1.update(str(timestamp).encode('utf8')) return sha1.hexdigest()

转载于:https://www.cnblogs.com/c-x-a/p/10447267.html

相关资源:Python实现常见的几种加密算法(MD5,SHA-1,HMAC,DES/AES,RSA和ECC)
最新回复(0)