Question: You are provided with the ds _ hash hash function. The function receives a finite message as input and produces a non - negative integer,
You are provided with the dshash hash function. The function receives a
finite message as input and produces a nonnegative integer, which we
consider to be the hash value of the given message.
The size of input messages is fixed and always equals bytes. Implement an
appropriate attack to check if the hash function dshash is strong collision
resistant. Your alphabet should include all lowercase and uppercase letters
of the English alphabet and all numbers from to
# START OF YOUR CODERUNNER SUBMISSION CODE
# INCLUDE ALL YOUR IMPORTS HERE
def dshashmessage: str int:
hashvalue
for ch in message:
hashvalue hashvalue ordch
return hashvalue & xFFFFFFF
def myAttack bool:
# YOUR IMPLEMENTATION
return # True or False
# END OF YOUR CODERUNNER SUBMISSION CODE
#You can test your code in your system NOT IN YOUR CODERUNNER SUBMISSION
as follows:
# MAIN
if namemain:
print myAttack
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
