So I have a brute force attacker, and I wanted to see how long it would take to crack my password. However, when I went to a couple of sites like this that estimate your length or places that calculate how long it would take like this one here, they all say that a six-seven digit password could be cracked in under a second!
How can I speed up my brute force program to match speeds like these?
# Imports
import itertools
import time
# Brute force function
def tryPassword(passwordSet, stringTypeSet):
start = time.time()
chars = stringTypeSet
attempts = 0
for i in range(1, 9):
for letter in itertools.product(chars, repeat=i):
attempts += 1
letter = ''.join(letter)
if letter == passwordSet:
end = time.time()
distance = end - start
return (attempts, distance)
password = "123456"
# Allowed characters
stringType = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~!@#$%^&*()_-+=[{]}|:;'\",<.>/?"
tries, timeAmount = tryPassword(password, stringType)
print("CyanCoding's BFPC cracked the password %s in %s tries and %s seconds!" % (password, tries, timeAmount)))
Your alphabet set is 93 characters.
your pw is 6 characters
the search space is 93^6 = 646,990,183,449
If you can check 10^7 pw a second, you will still need
646,990,183,449 / 10^7 / (60 * 60) = 18 hours
to crack it.
corollary: if you can only check one million pw per second, you'll need 180 hours (over a week)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With