From 63ef12172155bd01f30fa5449dbd0faadafcc8e9 Mon Sep 17 00:00:00 2001 From: Bill Buchanan Date: Thu, 18 Feb 2021 21:35:51 +0000 Subject: [PATCH] Update README.md --- unit04_public_key/lab/README.md | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/unit04_public_key/lab/README.md b/unit04_public_key/lab/README.md index 373df94..8b276c6 100644 --- a/unit04_public_key/lab/README.md +++ b/unit04_public_key/lab/README.md @@ -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 y2 = x3 + 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: