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 SHA256 of a text of your choice.
import hashlib
BUF_SIZE =32768 # Read file in 32kb
hash_object = hashlib.sha256()
with open('','rb') as f:
while True:
data = f.read(BUF_SIZE)
hash_object.update(data)
if not data:
break
hex_dig = hash_object.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 hash.txt
*Make small changes to the file and calculate the hash again. Add the new hash to hash.txt 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!