From 94771a08fab63d9c201782829be70002558ab8d7 Mon Sep 17 00:00:00 2001 From: Abbhiishek Date: Sat, 1 Oct 2022 10:04:11 +0530 Subject: [PATCH] =?UTF-8?q?Password=20checker=20init=20=E2=9C=A8`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/Password Srength Checker/main.py | 43 ++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 scripts/Password Srength Checker/main.py diff --git a/scripts/Password Srength Checker/main.py b/scripts/Password Srength Checker/main.py new file mode 100644 index 0000000..61e53be --- /dev/null +++ b/scripts/Password Srength Checker/main.py @@ -0,0 +1,43 @@ +from password_strength import PasswordStats +import tkinter as tk +import math +from tkinter import messagebox + + +window = tk.Tk() +window.title("Password Strength Checker") +window.geometry("400x400") +label1 = tk.Label(window, text="") +label1.place(x=200, y=275) + + +def check(): + if entry.get() == "": + messagebox.showinfo("Error", "Password Can't be empty") + else: + result = PasswordStats(entry.get()) + final = result.strength() + label1["text"] = str(math.ceil(final*100)) + " %" + if final >= 0.66: + w.create_rectangle(105, 50, 300, 100, + fill="#27cf54", outline="white") + elif final > 0.10 and final < 0.40: + w.create_rectangle(105, 50, 300, 100, + fill="#f0f007", outline="white") + elif final <= 0.10: + w.create_rectangle(105, 50, 300, 100, + fill="#de3c3c", outline="white") + + +head = tk.Label(window, text="Password Strength calculator", + font=("helvetica", 15, "bold")) +head.pack(ipadx=12, ipady=12) +label = tk.Label(window, text="Enter Your Password", + font=("helvetica", 10, "bold")) +label.pack(ipadx=5, ipady=5) +entry = tk.Entry(window) +entry.pack(ipadx=30, ipady=5) +button = tk.Button(window, text="check", command=check) +button.pack(ipadx=5, ipady=5) +w = tk.Canvas(window, height=100, width=600) +w.pack()