From 06a0d06c0e49bd0ea4048760ce00fd5d562081bb Mon Sep 17 00:00:00 2001 From: Sahil Vohra <96307639+Sahilvohra-cs-AiMl@users.noreply.github.com> Date: Fri, 11 Oct 2024 00:55:13 +0530 Subject: [PATCH 1/2] Create Password_cracking.py Adding Password Cracking code in python --- other/Password_cracking.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 other/Password_cracking.py diff --git a/other/Password_cracking.py b/other/Password_cracking.py new file mode 100644 index 000000000000..ae26d5395f01 --- /dev/null +++ b/other/Password_cracking.py @@ -0,0 +1,14 @@ +from random import * +import os +u_pwd =input("enter a password") +pwd=['a','b','c','d','e','f','1','2','3','4','5','6','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','v','x','y','z'] +pw="" +while(pw!=u_pwd): + pw="" + for letter in range(len(u_pwd)): + guess_pwd=pwd[randint(0,17)] + pw=str(guess_pwd)+str(pw) + print(pw) + print("cracking password...") + os.system("cls") +print("your password is-",pw) From 106e8757c64df557fc8408c448f70ef152f266ab Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 19:26:12 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- other/Password_cracking.py | 50 ++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/other/Password_cracking.py b/other/Password_cracking.py index ae26d5395f01..163829e6bf73 100644 --- a/other/Password_cracking.py +++ b/other/Password_cracking.py @@ -1,14 +1,48 @@ from random import * import os -u_pwd =input("enter a password") -pwd=['a','b','c','d','e','f','1','2','3','4','5','6','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','v','x','y','z'] -pw="" -while(pw!=u_pwd): - pw="" + +u_pwd = input("enter a password") +pwd = [ + "a", + "b", + "c", + "d", + "e", + "f", + "1", + "2", + "3", + "4", + "5", + "6", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "w", + "v", + "x", + "y", + "z", +] +pw = "" +while pw != u_pwd: + pw = "" for letter in range(len(u_pwd)): - guess_pwd=pwd[randint(0,17)] - pw=str(guess_pwd)+str(pw) + guess_pwd = pwd[randint(0, 17)] + pw = str(guess_pwd) + str(pw) print(pw) print("cracking password...") os.system("cls") -print("your password is-",pw) +print("your password is-", pw)