Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def rotate(cipher_grille):
- rotated_grille = ['','','','']
- for i in range(3,-1,-1):
- for j in range(4):
- if j==0:
- rotated_grille[0]=rotated_grille[0]+cipher_grille[i][j]
- if j==1:
- rotated_grille[1]=rotated_grille[1]+cipher_grille[i][j]
- if j==2:
- rotated_grille[2]=rotated_grille[2]+cipher_grille[i][j]
- if j==3:
- rotated_grille[3]=rotated_grille[3]+cipher_grille[i][j]
- rotated_grille=tuple(rotated_grille)
- return rotated_grille
- def recall_password(cipher_grille, ciphered_password):
- password = ''
- for i in range(len(cipher_grille)):
- for j in range(4):
- if cipher_grille[i][j] == 'X':
- password = password + ciphered_password[i][j]
- for x in range(3):
- cipher_grille=rotate(cipher_grille)
- for i in range(4):
- for j in range(4):
- if cipher_grille[i][j] == 'X':
- password = password + ciphered_password[i][j]
- return password
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement