We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b912bc1 commit c3f65aeCopy full SHA for c3f65ae
encrypt.py
@@ -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