-
Notifications
You must be signed in to change notification settings - Fork 2
/
chepy_hash.py
37 lines (27 loc) · 1.12 KB
/
chepy_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
import lazy_import
hashid = lazy_import.lazy_module("hashid")
import chepy.core
class Hash(chepy.core.ChepyCore):
"""This plugin Chepy hashing functions"""
@chepy.core.ChepyDecorators.call_stack
def identify_hash(self):
"""Identify hash type
Tries to determine information about a given hash and suggests which
algorithm may have been used to generate it based on its length.
Returns:
Chepy: The Chepy object.
Examples:
>>> Chepy("6dcd4ce23d88e2ee9568ba546c007c63d9131c1b").identify_hash().o
[
{'hashcat': 100, 'john': 'raw-sha1', 'name': 'SHA-1'},
{'hashcat': 4500, 'john': None, 'name': 'Double SHA-1'},
{'hashcat': 6000, 'john': 'ripemd-160', 'name': 'RIPEMD-160'},
{'hashcat': None, 'john': None, 'name': 'Haval-160'},
...
]
"""
hashes = []
for h in hashid.HashID().identifyHash(self._convert_to_str()):
hashes.append({"name": h.name, "hashcat": h.hashcat, "john": h.john})
self.state = hashes
return self