Share your repls and programming experiences

← Back to all posts
Brute Force Password Cracker
CyanCoding (1415)

https://repl.it/@CyanCoding/Brute-Force-Password-Cracker
I built the Brute Force Password Cracker as a fun program to test out passwords, and to test my knowledge of Python 3 and its libraries.

Commentshotnewtop
bgrubert (39)

Please upvote this comment!

OwenBradstreet (84)

Hey dude. I'm not here to take a dump on your work, I can tell you spent a while making this, and it seems functional - I just wanted to give you some advice. A lot of this code could have been done way more efficiently, and it's very hard on the eyes. I have rewritten two of the excessively inefficient and hard to look at parts for you (Those if's with all the or's), you can take inspiration from it if you would like.

I hope this helps you out man.

PS - The parts I have rewritten can be distinguished by the large comments around the scripts. I completely fine with you flat out copying these scripts, I only ask you chuck some sort of comment somewhere saying I helped out. Thanks man.

https://repl.it/@OwenBradstreet/Brute-Force-Password-Cracker

OwenBradstreet (84)

@OwenBradstreet PS: I got 450 milliseconds reaction time on your Reaction Test :) I think I'm pretty good.

ABulman (7)

@OwenBradstreet it is pretty inefficient, a bit like their C# one

paulramnora (4)

I don't get it...I typed in the password as: abc123; and, it currently says 100 million passwords guessed so far...(and, it still hasn't gotten it right, yet)??? Continuing to guess: 150 million passwords guessed so far.../350 million passwords guessed so far/...-etc. Surely, 'abc123' can't be that difficult to guess...?! 450 million passwords guessed so far.../500 million passwords guessed so far... Maybe, it should have started off by checking a list of the most commonly used passwords, first. 600 million passwords guessed so far.../760 million passwords guessed so far.../950 million passwords guessed so far. 1 billion, 5 million passwords guessed so far. It makes you wonder if it'll ever guess it...??? Anyway, I'm going back to sleep...can't just sit here staring at the screen...when not a lot seems to be happening. I billion, 675 million passwords guessed so far... OMG! I billion, 850 million passwords guessed so far.../2 billion, 225 million passwords guessed so far...

I admire the coding, seriously; it shows admirable skill and understanding of the overall Python language(which is a hell of a lot more than I've got). However, the program itself does seem to take an inordinately long time to guess correctly even a very 'simple' password. It's not my wish to put anybody down...I deeply appreciate anybody who sticks with learning 'how to code'...in fact, I'm trying to do the same thing myself. I wonder how the program might have performed if I had simply typed in as the password: abc...without the 123 part at the end? Maybe, I'll stop it, and, try, again. OK, so it cracked the 'abc' password...in 9218 tries and 1 second. That's approximately 1217046 guessed passwords per second! So, I guess, it does work in certain specific cases.

Or, is it possible I might have typed the password wrong the first try...let me try entering: abc123, again. Hmm...the same result as before, apparently...55 million passwords guessed so far...

RilGames (0)

@paulramnora u have done this to me... why did u do this

ScratchyGamer31 (1)

Attempting to crack password via CyanCoding's BFPC...

This could be a while. Feel free to leave this page open while you use the computer.

2 billion, 495 million passwords guessed so far...

epicman702 (48)

@ScratchyGamer31
2 trillion, 495 billion, 135 million passwords guessed so far...
I never got that far...

itbarsoum (42)

Password Password

I typed in the password Password and we're currently at 800 million passwords and going...

minx28 (162)

Hi! This is a cool project and I really like the use of colour. However, in places, there are major issues with the code: in under 10 minutes, I cut your 323 lines of code down to 259, with several lines becoming much shorter and easier.
The key to this is the string module:

import string

This module has several highly useful constants:

print(string.ascii_lowercase)
print(string.ascii_uppercase)
print(string.digits)
print(string.punctuation)
print(string.printable)
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789
!"#$%&\'()*+,-./:;<=>[email protected][\\]^_`{|}~
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>[email protected][\\]^_`{|}~

I went through your code and replaced instances of "abcdefghijklmnopqrstuvwxyz" with string.ascii_lowercase for example.
The other thing I did was the section where you detect if certain groups of characters are in the password. You did

if "A" in password or "B" in password...

I changed this to

if any([char in password for char in string.acii_uppercase]):

The any function requires a list and if any of the items in the list are True, it returns True. The [char in password for char in string.acii_uppercase] creates a list: each item is True of False, depending on whether each character in string.ascii_uppercase is in the password. This means that if any of the upper case letters are in the password, our any() returns True. I did the same thing with the lowercase, digits and punctuation bits, the punctuation one being particularly satsisfying because previously you had individual if statements for each separate character.
Hope you found this comment useful, please upvote!
-minx

gamer1000111 (1)

verry funny program. It keeps it interesting by using different collours everywhere

hg0428 (36)

How does it go so fast? Mine is a similar concept but, goes much slower. @CyanCoding

hg0428 (36)

How does it go so fast? Mine is a similar concept but, much slower.

hg0428 (36)

I used the password 777777777777777777 and it is at "17 billion, 685 million passwords guessed so far..." and still loading!

SpaghettiSouls (0)

I put çuracaø as the password and at 250 mil it is still loading

cjwinchstr (0)

This is probably one of the coolest programs I've seen in a while. I'm new to programming as a whole and I've mostly been messing around with Python and Java. (Mainly python because the school I go to blocks command prompts so, Java's out of the question until I work around it)
But either way, this is the first time I've seen a brute force program, and I have to say I'm very intrigued.

bossotron13 (29)

The password penis took over 260 million try’s, had to go so cant continue further

ChristopherLi5 (9)

Bravo! Very good! Excellent! ..... dunno what to say

epicman702 (48)

I entered XDDDDDDDDDDDDDDDDD (maybe longer) for the password and its still going after one billion...

Thats why im laughing so hard!

JoshuaKing1 (7)

Password: a
1 try 1 second!

mz14128915 (0)

WOW, IT STOPPED AT 2 BILLION BECAUSE IT COULDN'T FIND OUT THE [email protected]#@$! OOF

mz14128915 (0)

HELP.. THIS IS TAKING SO LONG IM ALMOST AT 1 BILLION WHEN I JUST TYPED [email protected]$5^7[email protected]#$%^&(MARTIN

mz14128915 (0)

Wow, this takes so long sometimes....

mz14128915 (0)

LOL, BUT NOT BAD CODE AT LEAST, PRETTY NICE... BUT IT TAKES A WHILE

Luke_Watson (2)

Thanosisacoolkid.com

GameMaster1928 (41)

You should probably add a space after the inputs (input("input:") becomes input("input: ")), so it doesn't look weird. Otherwise, great!

itbarsoum (42)

#minor adjustments

No need for wait(8) here:
print(colored("CyanCoding's BFPC was created as a better version of the PIN Guesser which just fished around for numbers until it found your PIN", "magenta")) wait(8)

and at doneBefore = input(colored("Have you ever used this program before?", "yellow")).lower() just a minor fix: at the end of input string add space

PYer (2540)

Its crazy! Years (maybe 1 or 2) later your project is still on top! It is even still getting views. look at the one comment before me. in new of course, and that was 1 month ago! If you look at the most recent reply, it is 3 days ago. Since me posting this of course, on own bradstreets comment? I have no idea how you did this, this is really cool though.

ebest (590)

"might as well i've been waitin' for hours"

madmonster (8)

How does this work?!

CyanCoding (1415)

@madmonster It's pretty complex but it's a relatively simple algorithm. First it checks if your password is a, then b, then c, etc.. Once it gets to the end of all the characters it wants to try, it adds another and goes back so then it tries aa then ab then ac.

After it gets to the end of the second letter, it does that for the first letter so it would then go ba, bb, bc. Once that first letter hits the end once more, it adds a letter and becomes aaa. This is why it takes so long for longer passwords, but this way it can also crack any password.

adityakin (0)

but make facebook,twitter,gmail password brute force

Ryanand (32)

How about I make a Password protection software?