Question: class TimeAttack: def _ _ init _ _ ( self , access _ code: str , hidden _ contents: str ) : self. _ _

class TimeAttack:
def __init__(self, access_code: str, hidden_contents: str):
self.__private_access_code = access_code
self.__private_hidden_contents = hidden_contents
self.access_attempt_hash =0
def verify_access_code(self, attempt_code: str)-> Optional[str]:
current_hash =3
stored_access_code = self.__private_access_code
for index in range(min(len(attempt_code), len(stored_access_code))):
if attempt_code[index]!= stored_access_code[index]:
return None
for iteration in range(200+200* index):
current_hash +=1
current_hash *= current_hash
current_hash %=7
current_hash +=1
if len(attempt_code)!= len(stored_access_code):
return None
self.access_attempt_hash = current_hash
return self.__private_hidden_contents
---------------------------------------------------------------
def crackPassword(timeattack: TimeAttack -> Tuple[str, str]:
return (password, contents)
------------------------------------------------------
def crackPassword():
password = 'secretpass'
contents = 'password cracked'
timeattack = TimeAttack(password, contents)
pass, cont = crackPassword(timeattack)
My goal is to fill out the method crackPassword to find the correct password that is between 1 and 12 characters (only lower ascii letters)

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!