Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is a 3part problem in python working on cracking hashes. I have the first part which is cracking a single hash, but need assistance

This is a 3part problem in python working on cracking hashes. I have the first part which is cracking a single hash, but need assistance with cracking multiple hashes and

Part 2

The array rand_hashes contains 10 hashes generated randomly from the rockyou list. Write a function called crack_list that takes a list of hashes and returns a list of cracked passwords. Each of the cracked passwords should be a byte string.

Part 3

The variables hash4 and hash5 contain two mystery hashes. They are constructed by taking a word from the rockyou list and appending a single digit such as these examples: Monkey1 or Turkey2. Write a function that takes in a hash and solves this. The hashes are:

hash4 = '610c23407eb63d963c73cdda8703b506' hash5 = '82f1742b8fef8c2379698be495c29c3d'

Here is the code in Python:

from hashlib import md5 from random import sample

# The first 300 entries from the rockyou.txt file. This is a single string, # which will be split into an array further down. rockyou_str = """123456 12345 123456789 password iloveyou princess 1234567 rockyou 12345678 abc123 nicole daniel babygirl monkey lovely jessica 654321 michael ashley qwerty 111111 iloveu 000000 michelle tigger sunshine chocolate password1 soccer anthony friends butterfly purple angel jordan liverpool justin loveme 123123 football secret andrea carlos jennifer joshua bubbles 1234567890 superman hannah amanda loveyou pretty basketball andrew angels tweety flower playboy hello elizabeth hottie tinkerbell charlie samantha barbie chelsea lovers teamo jasmine brandon 666666 shadow melissa eminem matthew robert danielle forever family jonathan 987654321 computer whatever dragon vanessa cookie naruto summer sweety spongebob joseph junior softball taylor yellow daniela lauren mickey princesa alexandra alexis jesus estrella miguel william thomas beautiful mylove angela poohbear patrick iloveme sakura adrian alexander destiny christian 121212 sayang america dancer monica richard 112233 princess1 555555 diamond carolina steven rangers louise orange 789456 999999 shorty 11111 nathan snoopy gabriel hunter cherry killer sandra alejandro buster george brittany alejandra patricia rachel tequiero 7777777 cheese 159753 arsenal dolphin antonio heather david ginger stephanie peanut blink182 sweetie 222222 beauty 987654 victoria honey 00000 fernando pokemon maggie corazon chicken pepper cristina rainbow kisses manuel myspace rebelde angel1 ricardo babygurl heaven 55555 baseball martin greenday november alyssa madison mother 123321 123abc mahalkita batman september december morgan mariposa maria gabriela iloveyou2 bailey jeremy pamela kimberly gemini shannon pictures sophie jessie hellokitty claudia babygirl1 angelica austin mahalko victor horses tiffany mariana eduardo andres courtney kissme harley ronaldo iloveyou1 precious october inuyasha peaches veronica chris 888888 adriana cutie james banana prince friend jesus1 crystal celtic zxcvbnm edward oliver diana samsung freedom angelo kenneth master scooby carmen 456789 sebastian rebecca jackie spiderman christopher karina johnny hotmail 0123456789 school barcelona august orlando samuel cameron slipknot cutiepie monkey1 50cent bonita kevin maganda babyboy casper brenda adidas kitten karen mustang isabel natalie cuteako javier 789456123 123654 sarah bowwow portugal laura 777777 marvin"""

# Split and convert rockyou to array of byte strings. # This is the array you should use for cracking the hashes. rockyou = [ bytes(i, 'utf-8') for i in rockyou_str.split() ]

# Hashes of a few of the passwords. # Can you figure out which ones they are? hash0 = 'df53ca268240ca76670c8566ee54568a' hash1 = 'fe546279a62683de8ca334b673420696' hash2 = '5ebe2294ecd0e0f08eab7690d2a6ee69' hash3 = 'c8837b23ff8aaa8a2dde915473ce0991'

# Part1: crack a single hash def crack_one(target): for word in rockyou: if md5(word).hexdigest() == target: return word

# Select 10 random passwords and hash them rand_hashes = [ md5(p).hexdigest() for p in sample(rockyou, 10) ]

# Part2: crack the random hashes def crack_list():

...

# Part3: what are these passwords?

hash4 = '610c23407eb63d963c73cdda8703b506' hash5 = '82f1742b8fef8c2379698be495c29c3d'

# You may need this to help solve the problem digits = '0123456789'

def prob3(target):

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

Step: 3

blur-text-image

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

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

Define the term Working Capital Gap.

Answered: 1 week ago