-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathencrypt.py
More file actions
39 lines (38 loc) · 973 Bytes
/
encrypt.py
File metadata and controls
39 lines (38 loc) · 973 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
def decrypt(n):
print(n)
for i in range(0,len(n)):
if n[i]==str(0):
x=n.replace(str(0),"a")
if n[i]==str(1):
x=n.replace(str(1),"e")
if n[i]==str(2):
x=n.replace(str(2),"i")
if n[i]==str(2):
x=n.replace(str(2),"o")
if n[i]==str(3):
x=n.replace(str(3),"u")
y=x[::-1]
print("decrypted val",y)
if "aca" in y:
print(y.replace("aca",""))
def encrypt(val):
n= val[::-1]
print(n)
for i in range(0,len(n)):
if n[i]=="a":
x=n.replace("a", str(0))
if n[i]=="e":
x=n.replace("e", str(1))
if n[i]=="i":
x=n.replace("i", str(2))
if n[i]=="o":
x=n.replace("o", str(2))
if n[i]=="u":
x=n.replace("u", str(3))
a=x+"aca"
print("The encrypted value is",a)
decrypt(a)
def take_values():
val=str(input())
encrypt(val)
take_values()