D
D
Dancho672020-03-17 04:33:20
Python
Dancho67, 2020-03-17 04:33:20

What is the fastest way to brute force AES using Python?

I greet you, great and not so great minds of Habr. There is a goal - to brute force a value encrypted in AES 256. Presumably, the key can be an MD5 hash of 5 characters (Latin alphabet in both cases, numbers from 0 to 9 and special characters _-+=). I tried to write a bruteforcer myself, in Python (I know, the language is not one of the fastest, but other PLs, I don’t know beyond the “Hello World!” level), and since it works on the CPU, the result is slow, from the word at all. Tell me pazhazhushta, what options for accelerating this process can you offer? Personally, I would like to try to transfer the enumeration process to CUDA kernels, where, in theory, the increase should be at least 100 times. If someone can, then throw ready-made solutions.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
freeExec, 2020-03-17
@freeExec

No need to build a bike - Hashcat

R
Roma Tyutin, 2021-06-01
@tyutinofficial

import string
import math
import time
import random
from random import choice
import numpy as np
def sigmoid(x):
return 1/(1+np.exp(-x))
def exponent(x):
return np.exp(x)# y = e**x
word = string.ascii_letters
number = string.digits
punctuation = string.punctuation
time.sleep(1)
#brute = #speed brute
correctPassword = "94"
wrongPasswords = []
password = ""
length = 2
comb_pass = 0#all combination in bruteforce
chars = number
run = True
while run:
try:
password = ""
for i in range(length):
password += choice(chars)
if password not in wrongPasswords:
if password != correctPassword:
print(sorted(password))
wrongPasswords.append(password)
else:
run = False
break
except:
pass
print (password, "is correct password")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question