mirror of
https://github.com/billbuchanan/appliedcrypto.git
synced 2026-02-21 11:18:02 +00:00
Update README.md
This commit is contained in:
@@ -358,21 +358,22 @@ msg="Hello"
|
||||
type = 1
|
||||
cur=NIST192p
|
||||
|
||||
|
||||
sk = SigningKey.generate(curve=cur)
|
||||
|
||||
vk = sk.get_verifying_key()
|
||||
|
||||
signature = sk.sign(msg)
|
||||
signature = sk.sign(msg.encode())
|
||||
|
||||
print "Message:\t",msg
|
||||
print "Type:\t\t",cur.name
|
||||
print "========================="
|
||||
print ("Message:\t",msg)
|
||||
print ("Type:\t\t",cur.name)
|
||||
print ("=========================")
|
||||
|
||||
print "Signature:\t",base64.b64encode(signature)
|
||||
print ("Signature:\t",base64.b64encode(signature))
|
||||
|
||||
print "========================="
|
||||
print ("=========================")
|
||||
|
||||
print "Signatures match:\t",vk.verify(signature, msg)
|
||||
print ("Signatures match:\t",vk.verify(signature, msg.encode()))
|
||||
```
|
||||
|
||||
What are the signatures (you only need to note the first four characters) for a message of “Bob”, for the curves of NIST192p, NIST521p and SECP256k1:
|
||||
|
||||
Reference in New Issue
Block a user