Update README.md

This commit is contained in:
Bill Buchanan
2021-02-18 21:35:51 +00:00
committed by GitHub
parent 3a41b8304b
commit 63ef121721

View File

@@ -314,39 +314,28 @@ test="Test123"
alice = pyelliptic.ECC()
bob = pyelliptic.ECC()
print "++++Keys++++"
print "Bob's private key: "+bob.get_privkey().encode('hex')
print "Bob's public key: "+bob.get_pubkey().encode('hex')
print ("++++Keys++++")
print ("Bob's private key: ",bob.get_privkey().hex())
print ("Bob's public key: ",bob.get_pubkey().hex())
print
print "Alice's private key: "+alice.get_privkey().encode('hex')
print "Alice's public key: "+alice.get_pubkey().encode('hex')
print()
print ("Alice's private key: ",alice.get_privkey().hex())
print ("Alice's public key: ",alice.get_pubkey().hex())
ciphertext = alice.encrypt(test, bob.get_pubkey())
print "\n++++Encryption++++"
print ("\n++++Encryption++++")
print "Cipher: "+ciphertext.encode('hex')
print ("Cipher: "+ciphertext.hex())
print "Decrypt: "+bob.decrypt(ciphertext)
signature = bob.sign("Alice")
print
print "Bob verified: "+ str(pyelliptic.ECC(pubkey=bob.get_pubkey()).verify
(signature, "Alice"))
print ("Decrypt: "+bob.decrypt(ciphertext))
```
For a message of “Hello. Alice”, what is the ciphertext sent (just include the first four characters):
How is the signature used in this example?
### D.2
Lets say we create an elliptic curve with y<sup>2</sup> = x<sup>3</sup> + 7, and with a prime number of 89, generate the first five (x,y) points for the finite field elliptic curve. You can use the Python code at the following to generate them: