多西格HMAC
multisig-hmac-AmalieDue的Python项目详细描述
multisig hmac python版本
Multisig scheme for HMAC authentication
进行中的工作
使用
密钥管理可以在两种模式中的任何一种进行,一种是存储每个组件密钥,另一种是存储一个主种子并使用它来派生密钥。在
使用存储的密钥:
m=MultisigHMAC()# generate keys which need to be stored securely and need to be shared securely with each partyk1=m.keygen()k2=m.keygen()k3=m.keygen()# sign by each client with 2-of-3data=b'Hello world's1=m.sign(k1,data)s3=m.sign(k3,data)out=m.combine([s1,s3])sent=(out[0],base64.urlsafe_b64encode(out[1]))# --- network ---received=(sent[0],base64.urlsafe_b64decode(sent[1]))# verify on the serverthreshold=2keys=[k1,k2,k3]signature=receivedm.verify(keys,signature,data,threshold)
使用派生主密钥:
^{pr2}$- 项目
标签: