-
Notifications
You must be signed in to change notification settings - Fork 0
/
Kryptor.py
81 lines (74 loc) · 3.78 KB
/
Kryptor.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
os.system("clear")
from hashlib import sha256
print('''
/$$ /$$ /$$
| $$ /$$/ | $$
| $$ /$$/ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$
| $$$$$/ /$$__ $$| $$ | $$ /$$__ $$|_ $$_/ /$$__ $$ /$$__ $$
| $$ $$ | $$ \__/| $$ | $$| $$ \ $$ | $$ | $$ \ $$| $$ \__/
| $$\ $$ | $$ | $$ | $$| $$ | $$ | $$ /$$| $$ | $$| $$
| $$ \ $$| $$ | $$$$$$$| $$$$$$$/ | $$$$/| $$$$$$/| $$
|__/ \__/|__/ \____ $$| $$____/ \___/ \______/ |__/
/$$ | $$| $$
| $$$$$$/| $$
\______/ |__/
ENCODE XOR AND cesar CHRF
/$$ /$$ /$$$$$$ /$$$$$$$
| $$ / $$ /$$__ $$ | $$__ $$
| $$/ $$/ | $$ \ $$ | $$ \ $$
\ $$$$/ | $$ | $$ | $$$$$$$/
>$$ $$ | $$ | $$ | $$__ $$
/$$/\ $$ | $$ | $$ | $$ \ $$
| $$ \ $$ | $$$$$$/ | $$ | $$
|__/ |__/ \______/ |__/ |__/
__
/%/
██╗ ██╗ ██╗ ██████╗ ██████╗ ███████╗████████╗ █████╗
██║ ██║███║ ██╔═████╗ ██╔══██╗██╔════╝╚══██╔══╝██╔══██╗
██║ ██║╚██║ ██║██╔██║ ██████╔╝█████╗ ██║ ███████║
╚██╗ ██╔╝ ██║ ████╔╝██║ ██╔══██╗██╔══╝ ██║ ██╔══██║
╚████╔╝ ██║██╗╚██████╔╝ ██████╔╝███████╗ ██║ ██║ ██║
╚═══╝ ╚═╝╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝
XOR IS ONLY FOR LINUX !
]|
||>>>>>>>>>>>>>>>>>>>>>
||FurySec ||
||By H-TechDev36 ||
||>>>>>>>>>>>>>>>>>>>>>
]|
.________________________.
| www.furysec.webnode.fr |
|.______________________.|
DO NOT USE XOR ON WINDOWS !
:-++===[Use it on windows at your own risks]===++-:
on windows Kryptor do not crypt the file HE DESTROY IT !
''')
print("3 to decrypt Cersar [words]")
mode = int(input("Cesar = 1 [words] | XOR = 2 [files]>>> "))
if mode ==2:
entree = input("Name of file to Crypt/Uncrypt >>> ")
sortie = input("Final file : ")
key = input("Key : ")
keys = sha256(key.encode('utf-8')).digest()
with open(entree,'rb') as f_entree:
with open(sortie,'wb') as f_sortie:
i = 0
while f_entree.peek():
c = ord(f_entree.read(1))
j = i % len(keys)
b = bytes([c^keys[j]])
f_sortie.write(b)
i = i + 1
else:
Messageacrypter= input("Words to be crypted >>> ")
cle=24
acrypter=Messageacrypter.upper()
lg=len(acrypter)
MessageCrypte=""
for i in range(lg):
if acrypter[i]==' ':
MessageCrypte+=' '
else:
asc=ord(acrypter[i])+cle
MessageCrypte+=chr(asc+26*((asc<65)-(asc>90)))
print(MessageCrypte)