-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEncrypt-and-Decrypt-Text.py
27 lines (24 loc) · 1.02 KB
/
Encrypt-and-Decrypt-Text.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#This code allows the user to encrypt and decrypt specific words or phrases (e.g: th& q!#ck br+wn f+x j!mps +v&r th& l*zy d+g).
#It should be specific or else the code will not proceed.
#DATA ENCRYPTING
a = input("Kindly enter the string 'the quick brown fox jumps over the lazy dog' to encrypt: ")
b = "the quick brown fox jumps over the lazy dog"
while a != b:
c = input("Error. Please try again: ")
if c == b:
print("Encrypted string: th& q!#ck br+wn f+x j!mps +v&r th& l*zy d+g")
break
while a == b:
print("Encrypted string: th& q!#ck br+wn f+x j!mps +v&r th& l*zy d+g")
break
#DATA DECRYPTING
a = input("Kindly enter the string 'th& q!#ck br+wn f+x j!mps +v&r th& l*zy d+g' to decrypt: ")
b = "th& q!#ck br+wn f+x j!mps +v&r th& l*zy d+g"
while a != b:
c = input("Error. Please try again: ")
if c == b:
print("Decrypted string: the quick brown fox jumps over the lazy dog")
break
while a == b:
print("Decrypted string: the quick brown fox jumps over the lazy dog")
break