Compare commits
7 Commits
613e170d47
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 446b3d3fe8 | |||
| b470329d0f | |||
| e6c0fac826 | |||
| 4ba15eb22d | |||
| 69ecfa8140 | |||
| aa53aa6e01 | |||
|
|
8bcfd66850 |
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# not part of the thing
|
||||||
|
generator.py
|
||||||
|
./generator.py
|
||||||
|
# what is happening, gitignore not working
|
||||||
10
README.md
10
README.md
@@ -1,3 +1,9 @@
|
|||||||
# Password-Crack-Time-Checker
|
# Password-Crack-Checker
|
||||||
|
Password crack checker
|
||||||
|
|
||||||
Password Crack Time Checker
|
Just a simple password crack time checker, will think things like password123 is strong so don't use it for anything important.
|
||||||
|
|
||||||
|
To run:
|
||||||
|
Have python setup, download the code, run the main.py with python.
|
||||||
|
I may add a website version later so you don't need to download it, if it exists, the link will be under here.
|
||||||
|
It's not here.
|
||||||
63
main.py
Normal file
63
main.py
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
import string
|
||||||
|
|
||||||
|
def get_charecter_pool_size(password):
|
||||||
|
pool_size=0
|
||||||
|
|
||||||
|
has_lower=False
|
||||||
|
has_upper=False
|
||||||
|
has_digits=False
|
||||||
|
has_symbols=False
|
||||||
|
for i in password:
|
||||||
|
if i in string.ascii_lowercase:
|
||||||
|
has_lower=True
|
||||||
|
if i in string.ascii_uppercase:
|
||||||
|
has_upper=True
|
||||||
|
if i in string.digits:
|
||||||
|
has_digits=True
|
||||||
|
if i in string.punctuation:
|
||||||
|
has_symbols=True
|
||||||
|
letters=int(has_lower)+int(has_upper)
|
||||||
|
pool_size+=letters*(((((((((((((((((((((((((((((len(string.ascii_letters)-len(string.ascii_lowercase))))))))))))))))))))))))))))))
|
||||||
|
if has_digits:
|
||||||
|
pool_size+=len(string.digits)
|
||||||
|
if has_symbols:
|
||||||
|
pool_size+len(string.punctuation)
|
||||||
|
return pool_size
|
||||||
|
def calculate_combinations(pool_size,length):
|
||||||
|
return pool_size**length
|
||||||
|
def estimate_crack_time(combinations):
|
||||||
|
guesses_per_second=1000000
|
||||||
|
time=combinations//guesses_per_second
|
||||||
|
return time
|
||||||
|
def format_time(seconds):
|
||||||
|
hours=seconds//3600
|
||||||
|
seconds-=(hours*3600)
|
||||||
|
minutes=seconds//60
|
||||||
|
seconds-=(minutes*60)
|
||||||
|
return f"{hours} hours, {minutes} minutes, {seconds} seconds"
|
||||||
|
def get_strength_label(seconds):
|
||||||
|
if seconds<=60:
|
||||||
|
return "Very weak"
|
||||||
|
if seconds<3600:
|
||||||
|
return "Weak"
|
||||||
|
if seconds<43200:
|
||||||
|
return "Moderate"
|
||||||
|
if seconds<3.154e+7:
|
||||||
|
return "Strong"
|
||||||
|
return "Very Strong"
|
||||||
|
def main():
|
||||||
|
print("This will not account for human behavior, for example, password123 will be very strong according to this cracker, don't use this for something that needs to be secure.\nThis would give you the time it would take to brute force this length at 1 million guesses per second.")
|
||||||
|
password=input("Enter your password to check: ")
|
||||||
|
length=len(password)
|
||||||
|
pool_size=get_charecter_pool_size(password)
|
||||||
|
if pool_size<=0:
|
||||||
|
print("This is how secure your password is: , there it is, thats the security, it's that insecure, maybe set a real password.")
|
||||||
|
quit()
|
||||||
|
combinations=calculate_combinations(pool_size,length)
|
||||||
|
crack_time=estimate_crack_time(combinations)
|
||||||
|
print("Max possible characters:",pool_size)
|
||||||
|
print("Possible combinations:",combinations)
|
||||||
|
print("Estimated crack time:",format_time(crack_time))
|
||||||
|
print("Your password is",get_strength_label(crack_time))
|
||||||
|
|
||||||
|
main()
|
||||||
Reference in New Issue
Block a user