17 lines
367 B
Markdown
17 lines
367 B
Markdown
# Bruteforce hash \(few chars\)
|
|
|
|
```python
|
|
import hashlib
|
|
|
|
target = '2f2e2e' #/..
|
|
candidate = 0
|
|
while True:
|
|
plaintext = str(candidate)
|
|
hash = hashlib.md5(plaintext.encode('ascii')).hexdigest()
|
|
if hash[-1*(len(target)):] == target: #End in target
|
|
print('plaintext:"' + plaintext + '", md5:' + hash)
|
|
break
|
|
candidate = candidate + 1
|
|
```
|
|
|