mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-27 22:11:10 +00:00
Merge pull request #29 from Abbhiishek/password-checker
Password checker init ✨`
This commit is contained in:
commit
536c16f89c
38
scripts/Password Srength Checker/Readme.md
Normal file
38
scripts/Password Srength Checker/Readme.md
Normal file
|
@ -0,0 +1,38 @@
|
|||
# Password Strength Checker
|
||||
|
||||
This script checks the strength of a password. It uses the Password Strength Package to check the strength of the password.
|
||||
|
||||
|
||||
## ```How to use```
|
||||
|
||||
1. Install the Password Strength Package using the following command:
|
||||
|
||||
`pip install password-strength`
|
||||
|
||||
Official Documentation: https://pypi.org/project/password-strength/
|
||||
|
||||
2. Run the script and enter the password to check the strength of the password.
|
||||
|
||||
## ```Output```
|
||||
|
||||
The output will be a number percentage between 0 and 1. The higher the number, the stronger the password.
|
||||
|
||||
<img src="./demo.png">
|
||||
|
||||
## ```Test Cases```
|
||||
|
||||
The following test cases were used to test the script:
|
||||
|
||||
<div align="center">
|
||||
|
||||
| Password | Strength |
|
||||
| --- | --- |
|
||||
| milkywaygalaxy | 56% |
|
||||
| iamacoderfromkolkata@123 | 91% |
|
||||
| asdfghjkl | 32% |
|
||||
| Hacktoberfest2022 | 75% |
|
||||
|
||||
</div>
|
||||
|
||||
## Author
|
||||
Name: [Abhishek Kushwaha](https://github.com/Abbhiishek)
|
BIN
scripts/Password Srength Checker/demo.png
Normal file
BIN
scripts/Password Srength Checker/demo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 92 KiB |
44
scripts/Password Srength Checker/main.py
Normal file
44
scripts/Password Srength Checker/main.py
Normal file
|
@ -0,0 +1,44 @@
|
|||
from password_strength import PasswordStats
|
||||
import tkinter as tk
|
||||
import math
|
||||
from tkinter import messagebox
|
||||
|
||||
|
||||
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.65:
|
||||
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")
|
||||
|
||||
|
||||
window = tk.Tk()
|
||||
window.title("Password Strength Checker")
|
||||
window.geometry("400x400")
|
||||
label1 = tk.Label(window, text="")
|
||||
label1.place(x=200, y=275)
|
||||
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()
|
||||
|
||||
|
||||
window.mainloop()
|
Loading…
Reference in New Issue
Block a user