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:
@@ -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
|
||||
Let’s 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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user