Question: Use the Python code given to calculate the SHA 2 5 6 of a text of your choice. import hashlib BUF _ SIZE = 3
Use the Python code given to calculate the SHA of a text of your choice.
import hashlib
BUFSIZE # Read file in kb
hashobject hashlib.sha
with openrb as f:
while True:
data freadBUFSIZE
hashobject.updatedata
if not data:
break
hexdig hashobject.hexdigest
Extend the code to calculate the hash of a file you may use it on the excel files you created in the previous practical sessions and store the hash in a text file hashtxt
Make small changes to the file and calculate the hash again. Add the new hash to hashtxt and compare them. What do you notice?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
