Programming Assigment 2

profilePradhu
497_Assignment02-SumII2022-updated-sumII22.pdf

CSCI 497 Assignment 02

40 points

Instruction:

• Show your work (at least 50% penalty otherwise) Submit a single Word (.doc or .docx) document containing all your answers to the designated folder (“Assignment #2”) under Assignments (at least 10% penalty otherwise). Neither PDF documents nor documents in other formats would be accepted.

• Make sure if you submitted the intended one. It is recommended that you download what has been uploaded and double-check if the correct document has been submitted.

• You can submit as many times as you want, but the last submission will only be graded. If the last submission is made after the deadline, there should be a late submission penalty.

• No plagiarism: Do not copy and paste any from textbooks and other resources to answer questions (Zero will be given otherwise).

• No extension/resubmission request will be accepted.

Note: The instructor and TA will welcome your questions to clarify homework problems but do not ask if what you answered is correct. We may not reply from Friday evening to Monday morning.

Problem 1. Bitcoin Hashing (15 pt.)

a. Generate a pair of private and public key pair using ECDSA. Capture the screen

showing the generation process. Also attach the source code, the generated

private/public keys (in the textual format) to your submitted document.

ECDSA package: https://pypi.org/project/ecdsa/

b. Hash your address using SHA-224 and show its hashvalue containing only hexadecimal

digits using the hexdigest() method included in the module “hashlib”. Your address

here indicates the public key obtained in 1(a). Provide the source code, hashvalue, and

the captured screenshot in your submitted document.

Hashlib module: https://docs.python.org/3/library/hashlib.html

Problem 2. Incentives (15 pt.)

According to the rules of the bitcoin system, the block reward is cut in half every 210,000

blocks. Consider a different rule that the block reward becomes ¼ of the previous block

reward every 210,000 blocks (with other rules unchanged), assume that this different rule has

been used since the start of bitcoins. Will this change of the rule the total number of bitcoins?

a. If YES, what is the new total number of bitcoins?

b. If NO, explain the reason

c. If one block will be added every 20 minutes (not 10 minutes), how long does it for the

bitcoin system to generate 420,000 blocks? Please show the detailed calculation steps

and round it to an integer.

Problem 3.(This question is from Assignment01) Encrypting a string containing your CWID and full name (10 pt. )

Encrypt a string containing your CWID and full name using the following public key or the public key in the text file “publickey.txt”. Then attach the source code, encrypted string to your

submitted document. Encryption package: https://pypi.org/project/eciespy/

Public key: 0x24cc702312cf177b8739b21cb9a27c3e91ef8ed0fa737849928739d32c52b6940026e28547836dfc dac1f693f111f5cc8f6c3f9670a4692a6595815188da926c