def encryptAndSign(self, plaintext, recipientPublic):
try:
content = rsa.encrypt(plaintext, recipientPublic)
signature = rsa.sign(content, self.DRMPrivateKey, "SHA-1")
return pickle.dumps([signature, content])
except Exception as e:
debug("crypt", "Failed encrypting the message. -> %s" % str(e))
return
# Verify signature with sender's public key, then proceed to use
# our own private key to decrypt the message
# pass the expected timestamp, to thawrt rplay attacks. gets cryptd
Context.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录