Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions