Skip to content

Commit c3f65ae

Browse files
authored
Add files via upload
1 parent b912bc1 commit c3f65ae

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

encrypt.py

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import os
2+
from sys import argv
3+
from string import maketrans
4+
5+
6+
file_name = argv[1]
7+
8+
def rot13(text):
9+
text = "".join(map(lambda x:chr(ord(x)+13),list(text)))
10+
return text
11+
12+
try:
13+
def encrypt():
14+
global file_name
15+
file_write = open(file_name+'.enc','wb')
16+
file_open = open(file_name,'rb')
17+
for line in file_open:
18+
line = line.strip('\n')
19+
line = line.strip('\r')
20+
line = line[::-1]
21+
line = rot13(line)
22+
print line
23+
file_write.write(line+'\n')
24+
file_write.close()
25+
file_open.close()
26+
print "Successfully Encrypted the file"
27+
cmd = "rm "+file_name
28+
os.system(cmd)
29+
except Exception,e:
30+
print "Fucking Error :" + e
31+
32+
if __name__ == '__main__':
33+
encrypt()

0 commit comments

Comments
 (0)