Spaces:
Sleeping
Sleeping
update
Browse files- app.py +12 -7
- requirements.txt +1 -0
app.py
CHANGED
@@ -3,24 +3,29 @@ import re
|
|
3 |
|
4 |
|
5 |
st.title("Password Strength Checker")
|
|
|
6 |
|
7 |
|
8 |
password = st.text_input("Enter a Password to check its strength:", type="password")
|
9 |
|
10 |
|
11 |
if st.button("Check Password Strength"):
|
|
|
12 |
if password:
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
|
20 |
|
21 |
-
if
|
22 |
st.success("Password is Strong!")
|
23 |
else:
|
24 |
-
st.error("Password is Weak
|
|
|
25 |
else:
|
26 |
st.warning("Please enter a password to check.")
|
|
|
|
|
|
3 |
|
4 |
|
5 |
st.title("Password Strength Checker")
|
6 |
+
st.header("Let's Try If Your Password Is Strong Or Weak")
|
7 |
|
8 |
|
9 |
password = st.text_input("Enter a Password to check its strength:", type="password")
|
10 |
|
11 |
|
12 |
if st.button("Check Password Strength"):
|
13 |
+
st.button("clear")
|
14 |
if password:
|
15 |
|
16 |
+
uppercase = any(char.isupper() for char in password)
|
17 |
+
lowercase = any(char.islower() for char in password)
|
18 |
+
digit = any(char.isdigit() for char in password)
|
19 |
+
special_char = bool(re.search(r"[^b-zA-Z0-9]", password))
|
20 |
+
long = len(password) >= 8
|
21 |
|
22 |
|
23 |
+
if long and uppercase and lowercase and digit and special_char:
|
24 |
st.success("Password is Strong!")
|
25 |
else:
|
26 |
+
st.error("Password is Weak. Please Try Again")
|
27 |
+
st.error("You should include special characters or numbers.")
|
28 |
else:
|
29 |
st.warning("Please enter a password to check.")
|
30 |
+
|
31 |
+
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
streamlit
|