import re
import random
import string
import streamlit as st π These libraries help with password checking, generating strong passwords, and building the Streamlit GUI.
blacklist = ['password123', '123456', 'qwerty', 'admin', 'letmein']β These are insecure and common passwords that your app will reject.
def check_password_strength(password):
# Check for length, uppercase, lowercase, digits, and special charactersπ This function analyzes the user's password and gives feedback on how strong it is.
def generate_strong_password(length=12):
# Returns a random, strong passwordπ² This function creates a strong password using letters, numbers, and symbols.
def main():
st.markdown(...) # Title and credits
st.image(...) # Show icon imageπΌοΈ You added a title, emoji icon, and developer credits using st.markdown() and st.image().
st.markdown("""
<style>
body {
background-image: url('image.png');
...
}
</style>
""", unsafe_allow_html=True)π¨ You made the app visually appealing by using a custom background image.
password = st.text_input("π Enter your password:", type="password")π¬ This allows users to enter a password, and it hides the input for security.
if password:
score, feedback = check_password_strength(password)
# Display result: Weak, Moderate, or Strongπ§ Your app gives real-time analysis of password strength with emoji-based feedback.
if st.button("π² Generate a Strong Password"):
new_password = generate_strong_password()β‘ If user clicks the button, your app shows a secure, random password.
st.markdown("...Created by Ammara Dawood...")π Deployed: I uploaded my code to GitHub and deployed it online using Streamlit Cloud, so anyone can use it! πβ¨
π» I completed my app in Python using Streamlit and made sure everything works fine.
π I created a requirements.txt file with all necessary packages like streamlit.
πΌ I uploaded my project files (p-s-m.py, image.png, requirements.txt) to my GitHub repo.
π I logged into Streamlit Cloud with my GitHub account.
π I selected my GitHub repo, picked the main branch, and chose p-s-m.py as the app file.
π I hit the Deploy button and Streamlit hosted my app online.
π My app is now live! I received a public link like:
https://password-strength-meter-lxq8k62dxqfcpixvibvkur.streamlit.app/ which I can share with everyone. π₯³π