# Hash Functions: The Rho Method for Collision DetectionHash Functions: The Rho Method for Collision Detection

Learning Goal: I’m working on a cyber security question and need guidance to help me learn.

Import Hash Library

>>> import hashlib

>>> print(hashlib.new(‘md5’, “a”.encode(‘ascii’)).hexdigest())

Here, “a” is the message we are trying to hash.

‘md5’ is the hash function we are using.

From the example below the hash of “a” is 0cc175b9c0f1b6a831c399e269772661

>>> print(hashlib.new(‘md5’, “a”.encode(‘ascii’)).hexdigest()[-2:])

Last 2 hex values of the hash are 61

We will keep hashing for 50 times:

>>> import hashlib

>>> h = “a”

>>> for i in range(50):

… h = hashlib.new(‘md5’, h.encode(‘ascii’)).hexdigest()[-2:]

… print (h, end = ‘ ‘)

Find the loop:

61 91 94 ef 43 8b 7b d4 31 f5 dc 8f e0 87 6d 8a 19 c4 7a ee

1e 21 79 d7 98 ca d3 59 a2 c0 a8 a5 db 1b

1e 21 79 d7 98 ca d3 59 a2 c0 a8 a5 db 1b

1e 21

Try the same steps and start the truncated hash with an initial string of “password” instead of “a”. The first repeated hash value is the flag, find the loop. (You may need to run the loop a greater number of times than 50 to find collisions)

1. Keep the last three characters of the MD5 hash

2. Keep the last three characters of the SHA-256 hash (sha256)

3. Keep the last three characters of the SHA-512 hash (sha512)

Locate the repeated hash, and find the loop.

*It’s a report, show the steps and show the three loops separately, as shown in the example.

## Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
\$26
The price is based on these factors:
Number of pages
Urgency
Basic features
• Free title page and bibliography
• Unlimited revisions
• Plagiarism-free guarantee
• Money-back guarantee
On-demand options
• Writer’s samples
• Part-by-part delivery
• Overnight delivery
• Copies of used sources
Paper format
• 275 words per page
• 12 pt Arial/Times New Roman
• Double line spacing
• Any citation style (APA, MLA, Chicago/Turabian, Harvard)

# Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

### Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

### Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

### Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.