-
Notifications
You must be signed in to change notification settings - Fork 85
/
secretor.py
58 lines (43 loc) · 1.23 KB
/
secretor.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#Author = P4ul x Cyberpj
#date : oct 3 2022
#plain text into an invisible text using array and "\u200b" character
def enc():
text=input(" Enter a plain text : ")
nameoffile=input("save as : ")
word_ord=[]
secret_null=[]
file=open(f'{nameoffile}',"w")
for i in range(len(text)):
word_ord.append(ord(text[i]))
#print("word ord = ", word_ord)
for j in word_ord:
secret_null.append("\u200b"*j)
for i in range(len(secret_null)):
file.write(secret_null[i])
file.write("\n")
file.close()
print("file saved as : "+str(file.name))
def decoder():
sec=''
reader=input('enter a file name : ')
encfile=open(reader,'rb')
num=len(encfile.readlines())
output=open('decoded.txt','w')
anotherfile=open(reader,'r')
for i in range(num):
sec+=chr(len(anotherfile.readline())-1)
output.write(sec)
print(sec)
output.close()
anotherfile.close()
encfile.close()
print('''\t
⠄⠄⠄\t\t⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⠄⠄⠄⠄⠄SECRETOR⠄⠄⠄⠄⠄⠄⢿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀\t⠄⠄⠄
''')
inputer=int(input(" ENCODE = 1 \n DECODE = 2 \n >>>> "))
if(inputer==1):
enc()
elif(inputer==2):
decoder()
else:
print("Invalid input :(")