forked from Seyptoo/KilBinary
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDecrypt.py
More file actions
129 lines (103 loc) · 2.93 KB
/
Decrypt.py
File metadata and controls
129 lines (103 loc) · 2.93 KB
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
#coding:utf-8
import binascii
import sys
import subprocess
import options
CHECK_VERSION = sys.version_info <= (3,0)
if(CHECK_VERSION):
# Let's test if the program is in Python 2 or 3.
sys.exit("[!] Version of Python is incorrect.")
def BertModel(AlgorithmBytes):
"""
This function will test the algorithm.
Opp check the algorithm.
Parameters
----
AlgorithmBytes : It's the bytes in the hash
Return
----
He will return the hash with success.
"""
DecryptAlgorithm = ("")
NumberOne = 1
# We create the basic variables.
AlgorithmBytes = AlgorithmBytes.split("=")
for BytesOp in AlgorithmBytes:
# Create loop for hashsing.
if(BytesOp != ''):
# Test is variable is empty.
if("+" in BytesOp):
# Test for additions of hash and development.
BytesOp = BytesOp.split("+")
instanceResult = int(BytesOp[0]) + int(BytesOp[1])
elif("-" in BytesOp):
# Test then for subtractions and development.
BytesOp = BytesOp.split("-")
instanceResult = int(BytesOp[0]) - int(BytesOp[1])
elif("*" in BytesOp):
# Multiplications and split the variable next.
BytesOp = BytesOp.split("*")
instanceResult = int(BytesOp[0]) * int(BytesOp[1])
elif("/" in BytesOp):
# Division for data recovery.
BytesOp = BytesOp.split("/")
instanceResult = int(BytesOp[0]) / int(BytesOp[1])
if(NumberOne%2 != 0):
if(len(str(instanceResult)) < 3):
while len(str(instanceResult)) < 3:
instanceResult = "0"+str(instanceResult)
else:
if(len(str(instanceResult)) < 5):
while len(str(instanceResult)) < 5:
instanceResult = "0"+str(instanceResult)
DecryptAlgorithm += str(instanceResult)
NumberOne += 1
return(DecryptAlgorithm)
def BertPanel(BinaryCalc):
"""
This function will test the algorithm.
Opp check the algorithm.
Parameters
----
BinaryCalc : None
Return
----
He will return the hash with success.
"""
Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Alphabet = list(Alphabet)
AlgorithmDecrypt = ("")
for Character in BinaryCalc:
# Create loop for characters.
if Character in Alphabet:
# Create condition for testing.
Nulling = Alphabet.index(Character)
AlgorithmDecrypt += str(Nulling)
# Success for loop hashing.
else:
AlgorithmDecrypt += Character
return(AlgorithmDecrypt)
def BertPnnel(Texting):
"""
This function will test the algorithm.
Opp check the algorithm.
Parameters
----
Texting : None
Return
----
He will return the hash with success.
"""
ListBytes = [ bin(ord(ch))[2:].zfill(8) for ch in Texting ]
ArguLists = []
for Bytes in ListBytes:
SegmentOne = Bytes[:3]
SegmentTwo = Bytes[3:]
ArguLists.append(SegmentOne)
ArguLists.append(SegmentTwo)
return(ArguLists)
if __name__ == "__main__":
BinaryList = BertPanel(options.decrypt)
BinaryArguments = BertModel(BinaryList)
DecryptArguments = binascii.unhexlify('%x' % int('0b' + BinaryArguments, 2)).decode("ascii")
print("\n[+] Decrypt : "+DecryptArguments)