-
Notifications
You must be signed in to change notification settings - Fork 0
/
hash.py
128 lines (126 loc) · 4.08 KB
/
hash.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
#Programmer: Ahmed Mohamed (Al-Alamy)
#Channel YouTube : AL-Alamy Tube
#Encrypt v1.0
#####################################################
#colors
B="\033[0;30m" # Black
R="\033[0;31m" # Red
G="\033[0;32m" # Green
Y="\033[0;33m" # Yellow
b="\033[1;34m" # Blue
bs="\033[0;34m"# Blue sky
P="\033[0;35m" # Purple
C="\033[0;36m" # Cyan
W="\033[0;37m" # White
#####################################################
import os
import base64
import hashlib
os.system('clear')
print ("""\033[1;34m
+----------------INFO----------------+
| [+] Programmer:Ahmed Mohamed |
| [+] Channel:AL-Alamy Tube |
| [+] Gthub:AL-AlamySploit |
| [+] Encrypt v1.0 |
+------------------------------------+
[01] Base64
[02] Base32
[03] Base16
[04] MD4
[05] MD5
[06] SHA-1
[07] SHA-224
[08] SHA-256
[09] SHA-384
[10] SHA-512
[00] Exit
""")
A1 = raw_input ("""\033[1;34mEncrypt > """)
#Base64
if A1 == '1' :
import base64
print ("""\033[0;34m
[1] Encrypt
[2] Decrypt
""")
A1 = raw_input ("""\033[0;34mEncrypt > """)
if A1 == '1' :
encrypt = raw_input('\033[0;34mAnything for Encryption: ')
en=base64.b64encode(encrypt)
print ('\033[0;32m [+] Your Encryption: ' +en)
elif A1 == '2' :
decrypt = raw_input('\033[0;34mAnything for Decryption: ')
de = base64.b64decode(decrypt)
print ('\033[0;32m [+] your Decryption: ' +de)
#Base32
elif A1 == '2' :
import base64
print ("""\033[0;34m
[1] Encrypt
[2] Decrypt
""")
A1 = raw_input ("""\033[0;34mEncrypt > """)
if A1 == '1' :
encrypt = raw_input('\033[0;34mAnything for Encryption: ')
et=base64.b32encode(encrypt)
print ('\033[0;32m[+] Your Encryption: ' +et)
elif A1 == '2' :
decrypt = raw_input('\033[0;34mAnything for Decryption: ')
dt = base64.b32decode(decrypt)
print ('\033[0;32m[+] your Decryption: ' +dt)
#Base16
elif A1 == '3' :
import base64
print ("""\033[0;34m
[1] Encrypt
[2] Decrypt
""")
A1 = raw_input ("""\033[0;34mEncrypt > """)
if A1 == '1' :
encrypt = raw_input('\033[0;34mAnything for Encryption: ')
ey=base64.b16encode(encrypt)
print ('\033[0;32m[+] Your Encryption: ' +ey)
elif A1 == '2' :
decrypt = raw_input('\033[0;34mAnything for Decryption: ')
dy = base64.b16decode(decrypt)
print ('\033[0;32m[+] your Decryption: ' +dy)
##md4
elif A1 == '4' :
# in_user = raw_input('\033[0;34mEnter anything for Encryption : ')
# md4 = hashlib.md4(in_user).hexdigest()
# print ('\033[0;32m[+] Your Decryption : ' + md4)
print ("\033[0;31m[-] Not available. Please use another encryption type")
#md5
elif A1 == '5' :
in_user2 = raw_input('\033[0;34mEnter anything for Encryption : ')
md5 = hashlib.md5(in_user2).hexdigest()
print ('\033[0;32m[+] Your Decryption : ' + md5)
#sha1
elif A1 == '6' :
in_user3= raw_input('\033[0;34mEnter anything for Encryption : ')
sha1 = hashlib.sha1(in_user3).hexdigest()
print ('\033[0;32m[+] Your Decryption : ' + sha1)
#sha224
elif A1 == '7' :
in_user4 = raw_input('\033[0;34mEnter anything for Encryption : ')
sha224 = hashlib.sha224(in_user4).hexdigest()
print ('\033[0;32m[+] Your Decryption : ' + sha224)
#sha256
elif A1 == '8' :
in_user5 = raw_input('\033[0;34mEnter anything for Encryption : ')
sha256 = hashlib.sha256(in_user5).hexdigest()
print ('\033[0;32m[+] Your Decryption : ' + sha256)
#sha384
elif A1 == '9' :
in_user6 = raw_input('\033[0;34mEnter anything for Encryption : ')
sha384 = hashlib.sha384(in_user6).hexdigest()
print ('\033[0;32m[+] Your Decryption : ' + sha384)
#sha512
elif A1 == '10' :
in_user7 = raw_input('\033[0;34mEnter anything for Encryption : ')
sha512 = hashlib.sha512(in_user7).hexdigest()
print ('\033[0;32m[+] Your Decryption : ' + sha512)
#End
elif A1 == '0' :
sys.exit()