-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathcryptot.py
340 lines (286 loc) · 7.3 KB
/
cryptot.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
import enter
import base64
import hashlib
import os
import sys
from time import sleep
import requests
from bs4 import BeautifulSoup
from rsaaa import rsa_func
from xorr import xor_func
from eascc import aescc_func
from eascb import eascb_func
from descb import descb_func
from descc import descc_func
from rc22 import rc22_func
from rc44 import rc44_func
from chacha import chacha_func
from tlss import tlss_func
from dff import dff_func
from imcenc import imcenc_func
from imcdec import imcdec_func
from fileenc import fileenc_func
from filedecc import filedecc_func
def base644():
message = input("Enter String :")
message_bytes = message.encode('ascii')
base64_bytes = base64.b64encode(message_bytes)
base64_message = base64_bytes.decode('ascii')
print("Encode String : ", end="")
print(base64_message)
def base64d():
base64_message = input("Enter Base64 :")
base64_bytes = base64_message.encode('ascii')
message_bytes = base64.b64decode(base64_bytes)
message = message_bytes.decode('ascii')
print("Decoded Base64 : ", end="")
print(message)
def encodemdh5():
str2hash = input("Enter String :")
result = hashlib.md5(str2hash.encode())
print("Encode String : ", end="")
print(result.hexdigest())
def decodemdh5():
satr2hash = input("Enter hash :")
url = f"https://md5.gromweb.com/?md5={satr2hash}"
istek = requests.get(url)
soup = BeautifulSoup(istek.text, "lxml")
a = soup.findAll("em", {"class": "long-content string"})
for i in a:
print(i.text)
def shaa1():
str2hash = input("Enter String :")
result = hashlib.sha1(str2hash.encode())
print("Encode String : ", end="")
print(result.hexdigest())
def sha11():
str2hash = input("Enter hash :")
url = f"https://sha1.gromweb.com/?hash={str2hash}"
istek = requests.get(url)
soup = BeautifulSoup(istek.text, "lxml")
a = soup.findAll("em", {"class": "long-content string"})
for i in a:
print(i.text)
def shaa3():
str2hash = input("Enter String :")
result = hashlib.sha384(str2hash.encode())
print("Encode String : ", end="")
print(result.hexdigest())
def sha33():
str2hash = input("Enter hash :")
with open("aaaa.txt", "w") as f:
f.write(str2hash)
os.system("john --format=Raw-SHA384 aaaa.txt")
def shaa22():
str2hash = input("Enter String :")
result = hashlib.sha256(str2hash.encode())
print("Encode String : ", end="")
print(result.hexdigest())
def sha2():
str2hash = input("Enter hash :")
with open("aaaa.txt", "w") as f:
f.write(str2hash)
os.system("john --format=Raw-SHA256 aaaa.txt")
def shaa5():
str2hash = input("Enter String :")
result = hashlib.sha3_512(str2hash.encode())
print("Encode String : ", end="")
print(result.hexdigest())
def sha55():
str2hash = input("Enter hash :")
with open("aaaa.txt", "w") as f:
f.write(str2hash)
os.system("john --format=Raw-SHA512 aaaa.txt")
def hashh():
x = """
1) BASE64
2) MD5
3) SHA1
4) SHA384
5) SHA256
6) SHA512
7) GO BACK MAIN MENU
"""
print(x)
choosee = input("--------------->PLEASE CHOOSE :")
if choosee == "1":
a = input("1.Encryption \n2.Decryption \nChoose(1,2): ")
if a == "1":
base644()
sleep(3)
hashh()
elif a == "2":
base64d()
sleep(3)
hashh()
elif choosee == "2":
a = input("1. Encryption\n2. Decryption\nChoose(1,2): ")
if a == "1":
encodemdh5()
sleep(3)
hashh()
elif a == "2":
decodemdh5()
sleep(3)
hashh()
elif choosee == "3":
a = input("1. Encryption\n2. Decryption\nChoose(1,2): ")
if a == "1":
shaa1()
sleep(3)
hashh()
elif a == "2":
sha11()
sleep(3)
hashh()
elif choosee == "4":
a = input("1. Encryption\n2. Decryption\nChoose(1,2): ")
if a == "1":
shaa3()
sleep(3)
hashh()
elif a == "2":
sha33()
sleep(3)
hashh()
elif choosee == "5":
a = input("1.Encryption\n2. Decryption\nChoose(1,2): ")
if a == "1":
shaa22()
sleep(3)
hashh()
elif a == "2":
sha2()
sleep(3)
hashh()
elif choosee == "6":
a = input("1.Encryption\n2. Decryption\nChoose(1,2): ")
if a == "1":
shaa1()
sleep(3)
hashh()
elif a == "2":
sha11()
sleep(3)
hashh()
elif choosee == "7":
secim()
else:
print("Wrong Choose!!!!")
def rsaa():
rsa_func()
sleep(3)
secim()
def xorr():
xor_func()
sleep(3)
secim()
def aess():
aescc_func()
sleep(3)
secim()
def aessc():
eascb_func()
sleep(3)
secim()
def dese():
descb_func()
sleep(3)
secim()
def desc():
descc_func()
sleep(3)
secim()
def rc22():
rc22_func()
sleep(3)
secim()
def rc44():
rc44_func()
sleep(3)
secim()
def efss():
chacha_func()
sleep(3)
secim()
def tlss():
tlss_func()
sleep(3)
secim()
def diffiee():
dff_func()
sleep(3)
secim()
def imgenc():
a = input("1. Encryption\n2. Decryption\nChoose(1,2): ")
if a =="1":
imcenc_func()
print("Img Encrypted...")
sleep(2)
secim()
elif a == "2":
imcdec_func()
print("Img DEcrypted...")
sleep(2)
secim()
def fileenc():
a = input("1. Encryption\n2. Decryption\nChoose(1,2): ")
if a =="1":
fileenc_func()
print("Files Encrypted...")
sleep(2)
secim()
elif a == "2":
filedecc_func()
print("Files DEcrypted...")
sleep(2)
secim()
def secim():
while True:
y = """
> 1) HASH > 10) CHACHA20POLY1305
> 2) RSA > 11) TRANSPOSITION
> 3) XOR > 12) DIFFIE HELMAN
> 4) AES (ECC) > 13) IMAGE ENCRYPT/DECRYPT
> 5) AES (CBC) > 14) FILE ENCRYPT/DECRYPT
> 6) DES (ECB) > 15) EXIT
> 7) FERNET
> 8) RC2
> 9) RC4
"""
print(y)
choose = input("---->PLEASE CHOOSE ENCRYPTION METHOD :")
if choose == '1':
hashh()
elif choose == '2':
rsaa()
elif choose == '3':
xorr()
elif choose == '4':
aess()
elif choose == '5':
aessc()
elif choose == '6':
dese()
elif choose == '7':
desc()
elif choose == '8':
rc22()
elif choose == '9':
rc44()
elif choose == '10':
efss()
elif choose == '11':
tlss()
elif choose == '12':
diffiee()
elif choose == '13':
imgenc()
elif choose == '14':
fileenc()
elif choose == '15':
print("Exiting...")
sys.exit()
else:
print("Wrong Choose!!!!")
secim()