File tree 1 file changed +12
-17
lines changed
1 file changed +12
-17
lines changed Original file line number Diff line number Diff line change @@ -34,35 +34,30 @@ def brute_force(strng):
34
34
35
35
36
36
def main ():
37
- print ('-' * 10 + "\n **Menu**\n " + '-' * 10 )
38
- print ("1.Encrpyt" )
39
- print ("2.Decrypt" )
40
- print ("3.BruteForce" )
41
- print ("4.Quit" )
42
37
while True :
38
+ print ('-' * 10 + "\n **Menu**\n " + '-' * 10 )
39
+ print ("1.Encrpyt" )
40
+ print ("2.Decrypt" )
41
+ print ("3.BruteForce" )
42
+ print ("4.Quit" )
43
43
choice = input ("What would you like to do?: " )
44
44
if choice not in ['1' , '2' , '3' , '4' ]:
45
45
print ("Invalid choice" )
46
46
elif choice == '1' :
47
47
strng = input ("Please enter the string to be ecrypted: " )
48
- while True :
49
- key = int (input ("Please enter off-set between 1-94: " ))
50
- if key in range (1 , 95 ):
51
- print (encrypt (strng , key ))
52
- main ()
48
+ key = int (input ("Please enter off-set between 1-94: " ))
49
+ if key in range (1 , 95 ):
50
+ print (encrypt (strng .lower (), key ))
53
51
elif choice == '2' :
54
52
strng = input ("Please enter the string to be decrypted: " )
55
- while True :
56
- key = int (input ("Please enter off-set between 1-94: " ))
57
- if key > 0 and key <= 94 :
58
- print (decrypt (strng , key ))
59
- main ()
53
+ key = int (input ("Please enter off-set between 1-94: " ))
54
+ if key > 0 and key <= 94 :
55
+ print (decrypt (strng , key ))
60
56
elif choice == '3' :
61
57
strng = input ("Please enter the string to be decrypted: " )
62
58
brute_force (strng )
63
59
main ()
64
60
elif choice == '4' :
65
61
print ("Goodbye." )
66
- sys .exit ()
67
-
62
+ break
68
63
main ()
You can’t perform that action at this time.
0 commit comments