Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need this in Python language Problem 1: Basic birthday attack on a 40-bit hash - Finding collision of any two messages Write a function birthday10)

image text in transcribedNeed this in Python language

Problem 1: Basic birthday attack on a 40-bit hash - Finding collision of any two messages Write a function birthday10) that returns a tuple (s: t; n); where s and t are different ASCII strings whose SHA-1 hashes have the same high-order 40 bits (same 10 initial hex digits). The last component n of the return value is the number of calls to SHA-1. Again, you can generate random ASCII strings by converting random integers to hex. By the theory of these birthday attacks, you will need to compute somewhat more than 1 million square root of 240 = 220 hashes to find this collision with probability greater than y. The simplest way to do it is to repeatedly generate random strings s and enter the pair SHA-1(s):s in a Python dictionary structure. When you find a hash value that's already in the dictionary, you're done. Include two different colliding pairs of strings in your writeup. In addition, specify the time needed to find the collided pairs. Problem 1: Basic birthday attack on a 40-bit hash - Finding collision of any two messages Write a function birthday10) that returns a tuple (s: t; n); where s and t are different ASCII strings whose SHA-1 hashes have the same high-order 40 bits (same 10 initial hex digits). The last component n of the return value is the number of calls to SHA-1. Again, you can generate random ASCII strings by converting random integers to hex. By the theory of these birthday attacks, you will need to compute somewhat more than 1 million square root of 240 = 220 hashes to find this collision with probability greater than y. The simplest way to do it is to repeatedly generate random strings s and enter the pair SHA-1(s):s in a Python dictionary structure. When you find a hash value that's already in the dictionary, you're done. Include two different colliding pairs of strings in your writeup. In addition, specify the time needed to find the collided pairs

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Knowledge Discovery In Databases

Authors: Gregory Piatetsky-Shapiro, William Frawley

1st Edition

0262660709, 978-0262660709

More Books

Students also viewed these Databases questions

Question

Pinpoint major guidelines for effective use of PowerPoint.

Answered: 1 week ago