From e3848096653c2fec6609823c57782e76040d14ae Mon Sep 17 00:00:00 2001 From: Yash Mehrotra <128923633+ReDxDaGer@users.noreply.github.com> Date: Sat, 7 Oct 2023 21:37:04 +0530 Subject: [PATCH 1/2] Password breaker and generator --- python/main.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 python/main.py diff --git a/python/main.py b/python/main.py new file mode 100644 index 0000000..8f3a86e --- /dev/null +++ b/python/main.py @@ -0,0 +1,32 @@ +import random +import time +ch = "abcdefghijklmnopqurstuvwxyz1234567890!@#$%^&*()--+=AVCDEFGHIJKLMNOPQRSTUVWXYZ" +guess='' +password="" +length = int(input("Enter the length")) +lngth_half=int(length/2) +for i in range(lngth_half): + password += random.choice(ch[:4]) +for i in range(0,length-lngth_half): + password += random.choice(ch) +print(password) +user_inpt=input("You want to know if your password is easily breakable? (Yes/No)\n") +def passbrk(): + while True: + guess=random.choices(ch, k=len(password)) + guess=''.join(guess) + print(guess) + if guess==password: + print(f"Your pass is {guess}") + break +init = time.time() +strong =time.time()-init +if user_inpt=="Yes": + a = passbrk() + print(f"Time taken in is {strong}s") +else: + print("You didn't choose your password to be broken") +if strong >= 100: + print("Your password was stronger and was tough to break") +else: + print("Your pass was easily breakable") \ No newline at end of file From 873b9eeb8e80dc4d40380966cb92f4a6b7cb9138 Mon Sep 17 00:00:00 2001 From: Yash Mehrotra <128923633+ReDxDaGer@users.noreply.github.com> Date: Sat, 7 Oct 2023 21:37:54 +0530 Subject: [PATCH 2/2] Update main.py --- python/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/main.py b/python/main.py index 8f3a86e..e2a62b8 100644 --- a/python/main.py +++ b/python/main.py @@ -1,3 +1,4 @@ +# Password breaker and password generator import random import time ch = "abcdefghijklmnopqurstuvwxyz1234567890!@#$%^&*()--+=AVCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -29,4 +30,4 @@ def passbrk(): if strong >= 100: print("Your password was stronger and was tough to break") else: - print("Your pass was easily breakable") \ No newline at end of file + print("Your pass was easily breakable")