Question: Implement the hash functions given i n ( a ) and ( b ) : ( a ) Given n = p q b e

Implement the hash functions given in(a) and (b):
(a) Given n=pqbe the product of two distinct large primes and let h1(x)be a hash function, where h1(x)=x2(modn). Attacker knows n, but not p and q.
(b) Suppose a message mis divided into blocks of length 160 bits: m=M1||M2||....||Mr. Let h2(x)be a hash function, where h2(m)=M1M2...Mn.
For each of the hash functions, analyze on paper whether they adhere to the following properties: one-way, weak collision resistance, and strong collision resistance. If any function fails to uphold any of these properties, develop a program to illustrate it. Specifically:
One-way: If the function doesn't comply with the one-way property, create a program to compute x given its hash value h(x). Consequently, demonstrate that your code can calculate at least one such x.
Weak-collision Resistance: Should the function lack weak-collision resistance, construct a program to discover ay given x such that h(x)=h(y). Subsequently, demonstrate that your code can find at least one such y.
Strong-collision Resistance: If the function fails to satisfy strong-collision resistance, devise a program to identify a pair (x,y) such that h(x)=h(y). Then, showcase that your code can find at least one such pair (x,y).
Question 1(60 points):
Implement the hash functions given in(a) and (b):
(a) Given n=pqbe the product of two distinct large primes and let h1(x)be a hash function, where
h1(x)=x2(modn). Attacker knows n, but not p and q.
(b) Suppose a message mis divided into blocks of length 160 bits: m=M1||M2||dots..||Mr. Let h2(x)be
a hash function, where h2(m)=M1o+M2dotso+Mn.
For each of the hash functions, analyze on paper whether they adhere to the following properties:
one-way, weak collision resistance, and strong collision resistance. If any function fails to uphold any
of these properties, develop a program to illustrate it. Specifically:
One-way: If the function doesn't comply with the one-way property, create a program to compute x
given its hash value h(x). Consequently, demonstrate that your code can calculate at least one such
x.
Weak-collision Resistance: Should the function lack weak-collision resistance, construct a program
to discover ay given x such that h(x)=h(y). Subsequently, demonstrate that you Pls remember that attacker know nothing about b
Implement the hash functions given i n ( a ) and

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 Programming Questions!