1. 首页
  2. 数据库
  3. 其它
  4. crytposerver:将HMACing委托给服务器 源码

crytposerver:将HMACing委托给服务器 源码

上传者: 2021-04-27 17:33:45上传 ZIP文件 16.19KB 热度 11次
加密服务器 CryptoServer提供了一种将加密hmac委托给服务器的技术。 作者认为这对于许多应用程序都具有优势。 它是专为秘密创建后不可旋转的情况而设计的。 我们通过使用大量秘密来解决此问题。 即使处理了数百万个请求,两次使用同一秘密的可能性也接近于0。 用法 为了证明这一点,我们将从标准的python代码开始,然后将其重构为使用cryptoserver。 import hmac from hashlib import sha256 # A secret key, hardcoded or stored in AWS secrets # or read from the file system etc. SECRET_KEY = bytes . fromhex ( "13dd9f2fed7d8c61a1782d450ee3505e" ) def compute ( ms
下载地址
用户评论