Question: class TimeAttack: def _ _ init _ _ ( self , access _ code: str , hidden _ contents: str ) : self. _ _
class TimeAttack:
def initself accesscode: str hiddencontents: str:
self.privateaccesscode accesscode
self.privatehiddencontents hiddencontents
self.accessattempthash
def verifyaccesscodeself attemptcode: str Optionalstr:
currenthash
storedaccesscode self.privateaccesscode
for index in rangeminlenattemptcode lenstoredaccesscode:
if attemptcodeindex storedaccesscodeindex:
return None
for iteration in range index:
currenthash
currenthash currenthash
currenthash
currenthash
if lenattemptcode lenstoredaccesscode:
return None
self.accessattempthash currenthash
return self.privatehiddencontents
def crackPasswordtimeattack: TimeAttack Tuplestr str:
return password contents
def crackPassword:
password 'secretpass'
contents 'password cracked'
timeattack TimeAttackpassword contents
pass, cont crackPasswordtimeattack
My goal is to fill out the method crackPassword to find the correct password that is between and characters only lower ascii letters
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
