diff --git a/LICENSE b/LICENSE index cde4ac6..e860cd7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,6 @@ This is free and unencumbered software released into the public domain. +<<<<<<< HEAD Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and @@ -8,3 +9,27 @@ successors. We intend this dedication to be an overt act of relinquishment in pe THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to +======= +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to +>>>>>>> 9bab5dc (Initial commit) diff --git a/README.md b/README.md index 1fe7fc7..c269725 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ -# Password-Crack-Time-Checker - -Password Crack Time Checker \ No newline at end of file +# Password-Crack-Checker +Password crack checker diff --git a/generator.py b/generator.py new file mode 100644 index 0000000..0d182d1 --- /dev/null +++ b/generator.py @@ -0,0 +1,31 @@ +import random +import string +import questionary + +def generate_password(length,use_upper=True,use_lower=True,use_digits=True,use_symbols=True): + characters="" + if use_upper:characters+=string.ascii_uppercase + if use_lower:characters+=string.ascii_lowercase + if use_digits:characters+=string.ascii_uppercase + if use_symbols:characters+=string.punctuation + characterslist=list(characters) + password="" + if not characters: + return "" + for i in range(length): + password+=random.choice(characterslist) + return password +def main(): + print("Bitwarden password generator clone") + length=questionary.text("How long?",validate=lambda text: True if text.isdigit() else "Please enter a valid number").ask() + use_upper=questionary.confirm("Use uppercase?").ask() + use_lower=questionary.confirm("Use lowercase?").ask() + use_digits=questionary.confirm("Use digits?").ask() + use_symbols=questionary.confirm("Use symbols?").ask() + pw=generate_password(int(length),use_upper,use_lower,use_digits,use_symbols) + if pw: + print(pw) + else: + print("You didn't choose anything to put in, here's your password anyway: \"\"") +if __name__=="__main__": + main() \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..c0cdd8a --- /dev/null +++ b/main.py @@ -0,0 +1,65 @@ +import string +import time +time.strftime("%s %d") + +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() \ No newline at end of file