O
O
object_Object2022-02-11 20:52:50
Python
object_Object, 2022-02-11 20:52:50

How to speed up brute force?

In general, there is a line (just an example):

{"data":"ZbGOHhmbCr6SaaQUdMR7cMTXShhzlzpWVqXHA==","iv":"5y1WPN7nqaahg==","salt":"TaKtjVSlsplJKyKn0FzGrJ42BowgeFFssSx1k="}'

To decrypt this string, there is the following code

import json
try:
    data = json.loads(info)
    password = passwd
    salt = base64.b64decode(data['salt'])
    vault = base64.b64decode(data['data'])
    iv = base64.b64decode(data['iv'])
except:
    return None

key = hashlib.pbkdf2_hmac('sha256', password.encode('utf-8', 'ignore'), salt, 10000, 32)

from Crypto.Cipher import AES
decrypted_block = AES.new(key, AES.MODE_GCM, nonce=iv).decrypt(vault)
try:
    if decrypted_block.decode('utf-8', 'ignore').__contains__('"findThis":"'):
        something = decrypted_block.decode('utf-8', 'ignore').find('"findThis":"') + 12
        something2 = decrypted_block.decode('utf-8', 'ignore').find('","numberOfAccounts"') - 43
        decryptedData = decrypted_block.decode('utf-8', 'ignore')[something:][:something2]
        return {'data': decryptedData, 'password': passwd}
    else:
        return None
except:
    return None

I tried to make a Bruteforcer, but it can sort out 100-500 passwords per second, and I don’t understand python very well, is there an option how to speed up this whole thing to several million combinations per second, like here https://github.com/sebastien- riou/aes-brute-force

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2022-02-11
@ThunderCat

is there an option how to speed up this whole thing to several million combinations per second like here
Iron to change, then it is possible. And so - he is a brute and in Africa a brute, everything depends on the percentage, the software environment can win a couple of percent, but even the assembler will not give a serious performance boost on such a task.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question