Skip to content
← Back to Community
Brute Force Password Cracker
Profile icon
CyanCoding

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.

Thanks for 1,000 likes :D
-Camden, 12/1/2020

Voters
Profile icon
iliesleplusbes
Profile icon
itsslati
Profile icon
MRHACKER370
Profile icon
cacapompa2
Profile icon
HhhKkkk1
Profile icon
Customer-Support
Profile icon
Giroooooo
Profile icon
ivo220308
Profile icon
Vitrox0100
Profile icon
arsalenenefissi
Comments
hotnewtop
Profile icon
OldWizard209

I did the 1000th upvote. @CyanCoding
:)

Not taking any credit tho

Profile icon
CyanCoding

@abdullahrajput9 CONGRATULATIONS BRO! THANK YOU SO MUCH.

Profile icon
OldWizard209

No problem man @CyanCoding You deserved it :)

Profile icon
OwenBradstreet

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

Profile icon
OwenBradstreet

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

Profile icon
ABulman

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

Profile icon
JohnChen17

@OwenBradstreet i got 259ms

Profile icon
Michael8910

@OwenBradstreet I did a reaction time test and got 8 milliseconds. I just clicked and as soon as I did it turned green

Profile icon
LaneMartin

@OwenBradstreet uhh wow u got a big chunk of ur updoots from this comment lool pogger

Profile icon
Bunnytoes

@ABulman the c# obe has 80 lines of code, seems pretty efficient to me

Profile icon
NehalRam

@OwenBradstreet 404 not found error?

Profile icon
awesome10

i did a keyboard mash..
5 million guessed so far...
10 mil...
15 mil...
20mil...
25mil..
30mil...
35mil...
40miil...
45mil...
50mil...
55mil...
this could be a while.Feel free to leave this page open while you use the computer.
70 mil...
75mil...
80mil...
85mil...
90mil...
95mil...
edit: i waited and...
500million guessed so far...
imma keep waiting
update: 1bil, 20mil guessed so far...
still going... 1bil 500mil...
omg 2 billion+

Profile icon
Royb2010
Profile icon
ninjaread99

@awesome10 i got 3.5+ billion

Profile icon
Nayoar

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

Profile icon
EpicRaisin

image
😏
1024 upvotes
only master programmers will know

Profile icon
dontbanmeplz

@EpicRaisin Ha changed it

Profile icon
InvisibleOne
Profile icon
ninjaread99

@EpicRaisin NOT THE LIGHT THEME

Profile icon
MPoelsma

@EpicRaisin you mean 10000000000 updoots

Profile icon
ubrs

@EpicRaisin 1 giggerbyte

Profile icon
HyperAlternative
Profile icon
EpicRaisin

how the heck is this still getting comments

Profile icon
HyperAlternative

@EpicRaisin lol, i made the digging simulator

Profile icon
HyperAlternative

@EpicRaisin my digging simulator has way more likes

Profile icon
SharkCoding

leeeets get 1000 vooooooooteeeeeeeessssss peeeeeeooooooppppppppllllllleeee

Profile icon
FlaminHotValdez

@IsaacRoot PETITION TO GET BFPC TO 1000 UPVOTES ITS 9 AWAY AAAAAAAAAAAAAAAAA

Profile icon
SharkCoding

now only 8 away!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Profile icon
FlaminHotValdez

@IsaacRoot REEEEEEEEEEEEEEEEEEEE 1000!

Profile icon
world345

It now 1206

Profile icon
FlaminHotValdez

Petition to get this to 1000 cycles

Profile icon
hg0428

takes too LONG

Profile icon
CodingCactus

@hg0428 it's brute force, if it was quick, then everyone's account would be hacked

Profile icon
LilWolfy

That would be REALLY sad... 😔 @CodingCactus

Profile icon
NehalRam

@hg0428 i think its cause its python and it might be slow , c# brute force password crackers are much faster

Profile icon
hg0428

I have made one of these before and it was [email protected]

Profile icon
paulramnora

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...

Profile icon
RilGames

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

Profile icon
lynnlo

@paulramnora
this doesn't use rainbow tables, in regular cracking we... I mean the crackers will use a rainbow table that'll check for common passwords like password password123 acdefg 12345678 Pa$$w0rd first and get the accounts that's the least secure in most cases getting the secure accounts are not worth the computing resources to bf.

Profile icon
HenryZelonka1

@tharlynnhtetong
That's why it's called "brute force."

Profile icon
RayhanADev

Let’s get this to 1000 upvotes people!

Profile icon
CyanCoding

@RayhanADev yes lets do it😂

Profile icon
RayhanADev

@CyanCoding “I am inactive on Repl.it” lmao xD.

Profile icon
CyanCoding

@RayhanADev I use repl.it like once a week for small tests only but this is a comment I could get behind so I decided to respond😂

Profile icon
RayhanADev

@CyanCoding noice xD! Seriously wish you came around the community more often though. I can tell you are an og lol.

Profile icon
FlaminHotValdez

@CyanCoding aw man that sucks... But I noticed you changed your bio so you don't have the "I am inactive on repl.it" part, are you gonna come back?

Profile icon
FlaminHotValdez

@RayhanADev YES PLZ

Profile icon
RayhanADev

@maxyang lmao ;P. We’re close, only 38 more upvotes!

Profile icon
RayhanADev

@maxyang did you know cyancoding would have 797 cycles without this project?

Profile icon
CyanCoding

@RayhanADev Nobody would know me if I didn't have this program hahaha

Profile icon
RayhanADev

@CyanCoding wow, thats really sad xD.

Profile icon
FlaminHotValdez

@RayhanADev REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 1000

Profile icon
ScratchyGamer31

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...

Profile icon
YeetMstr

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

Profile icon
itbarsoum

Password Password

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

Profile icon
itbarsoum

1 billion ...

Profile icon
Writerfrighter

Its not useing the rainbow thing so XD @itbarsoum

Profile icon
ch1ck3n
Profile icon
AlmightyDeaks

@ch1ck3n you whent for an a then

Profile icon
SagittariusJQ

7 tri, 5 bil, 2 mil guesses for my password??? :o

Profile icon
SagittariusJQ

@SagittariusJQ Has anyone got that far yet, or is it just me?

Profile icon
a-repl-user

@SagittariusJQ

7 tri, 5 bil, 2 mil guesses for my password??? :o

Do you have a life

I don't think so lol, good job you have a very secure password :P

Profile icon
devER-M

EVEN I MADE ONE!

import random import time characters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", \ "m", "n", "o", "p", "r", "s", "t", "u", "x", "y", "0", "1", \ "2", "3", "4", "5", "6", "7", "8", "9", "q", "v", "z"] target_password = "" password_length = 3 reps = [0, 1] status = "ongoing" all_guesses = 0 digits = {1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0} def generate(): global password_length, digits, status char_count = 0 current_guess = "" index_counter = password_length while char_count < password_length: char_count += 1 current_guess += characters[digits[char_count]] digits_modded = "no" while digits_modded != "yes": if digits[index_counter] < (len(characters) - 1): digits[index_counter] += 1 digits_modded = "yes" else: if index_counter > 1: digits[index_counter] = 0 index_counter -= 1 if digits[index_counter] < (len(characters) - 1): digits[index_counter] += 1 digits_modded = "yes" else: digits_modded = "yes" status = "not_found" print(status, current_guess) return current_guess total_time = 0.0 while reps[0] < reps[1]: status = "ongoing" for pos in digits: digits[pos] = 0 if reps[1] > 1: target_password = "" while len(target_password) < password_length: target_password += random.choice(characters) reps[0] += 1 else: target_password = str(input("Enter a password to test\n")) password_length = len(target_password) if target_password == "": reps[0] += 1 status = "stopped" this_time = time.time() guesses = 0 while status == "ongoing": guesses += 1 if generate() == target_password: elapsed = time.time() - this_time status = "Cracked" print(status + ": " + target_password) print(str(guesses) + " guesses, " + str(elapsed) + " seconds.\n___________\n") all_guesses += guesses total_time += elapsed if reps[1] > 1: print(str(all_guesses / reps[1]) + " guesses per password") print(str(total_time / reps[1]) + " seconds per password")
Profile icon
Angelzeng

1 BILLION, 665 MILLION PASSWORD GUESSED SO FAR?!

Profile icon
Angelzeng

1 BILLION, 445 MILLION PASSWORDS GUESSED SO FAR?!

Profile icon
Writerfrighter

I put in a synbol... its going to guess forever

Profile icon
CharlieGolding1

550 mill paswords till it found it

Profile icon
stoporinjail

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

Profile icon
stoporinjail

I can see why this takes up more than half of your upvotes!

Profile icon
stoporinjail

I like the colors

Profile icon
LaneMartin

Profile icon
powerbox1000

355414 guesses to find test (i told it lowercase)

Profile icon
powerbox1000

This is how to know your password's security

Profile icon
CaidenHolst

This program is curretnly over 200 mil guesses to guess the password "Password"

Profile icon
AlmightyDeaks

i ran my password i tried through a password strength checker and it said 17 NOVEMDECILLION years, will this program ever give up

Profile icon
mollthecoder

The last number is out of the upvote box!

Profile icon
billwalbuck

I am happy now I was upvote 1169.