Question: run these python code with defrent random masege ( import hashlib import random def find _ collision ( ) : hashes = { } while

run these python code with defrent random masege (import hashlib
import random
def find_collision():
hashes ={}
while True:
message =''.join(chr(random.randint(0,255)) for _ in range(16))
sha1_hash = hashlib.sha1(message.encode()).hexdigest()
first_60_bits = sha1_hash[:15] # Extract the first 60 bits (15 nibbles)
if first_60_bits in hashes:
return message, hashes[first_60_bits]
else:
hashes[first_60_bits]= message
message1, message2= find_collision()
print("Collision found:")
print("Message 1:", message1)
print("Message 2:", message2))and shwe the output

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!