Skip to content

kAmmarah/password-strength-meter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”§ Step-by-Step Guide to Build Password Strength Meter App in Streamlit


πŸͺ„ Step 1: Import Required Libraries

import re  
import random  
import string  
import streamlit as st  

πŸ“Œ These libraries help with password checking, generating strong passwords, and building the Streamlit GUI.


πŸ“΅ Step 2: Define a List of Common Weak Passwords

blacklist = ['password123', '123456', 'qwerty', 'admin', 'letmein']

❌ These are insecure and common passwords that your app will reject.


🧠 Step 3: Create a Function to Check Password Strength

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.


πŸ” Step 4: Create a Function to Generate Strong Passwords

def generate_strong_password(length=12):
    # Returns a random, strong password

🎲 This function creates a strong password using letters, numbers, and symbols.


🌐 Step 5: Design Streamlit GUI

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().


🌈 Step 6: Set a Background Image with Custom CSS

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.


πŸ”‘ Step 7: Take User Input for Password

password = st.text_input("πŸ”‘ Enter your password:", type="password")

πŸ’¬ This allows users to enter a password, and it hides the input for security.


🧾 Step 8: Analyze Password and Show Feedback

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.


🎲 Step 9: Generate Strong Password on Button Click

if st.button("🎲 Generate a Strong Password"):
    new_password = generate_strong_password()

⚑ If user clicks the button, your app shows a secure, random password.


🧼 Step 10: Add Final Touch with Watermark

st.markdown("...Created by Ammara Dawood...")

🌟 You gave yourself credit at the bottom with a clean horizontal line and glowing text.


🌐 Deployed: I uploaded my code to GitHub and deployed it online using Streamlit Cloud, so anyone can use it! πŸš€βœ¨


🧩 Step-by-Step Deployment:


1️⃣ Code Ready

πŸ’» I completed my app in Python using Streamlit and made sure everything works fine.


2️⃣ Requirements File

πŸ“„ I created a requirements.txt file with all necessary packages like streamlit.


3️⃣ GitHub Upload

πŸ”Ό I uploaded my project files (p-s-m.py, image.png, requirements.txt) to my GitHub repo.


4️⃣ Streamlit Cloud Login

πŸ” I logged into Streamlit Cloud with my GitHub account.


5️⃣ Connected Repo

πŸ”— I selected my GitHub repo, picked the main branch, and chose p-s-m.py as the app file.


6️⃣ Clicked Deploy

πŸš€ I hit the Deploy button and Streamlit hosted my app online.


7️⃣ Got My Public URL

🌍 My app is now live! I received a public link like:
https://password-strength-meter-lxq8k62dxqfcpixvibvkur.streamlit.app/ which I can share with everyone. πŸ₯³πŸ’–


πŸ‘©β€πŸ’»πŸ”πŸŒ Thank you for checking out my app β€” hope you enjoy using it! πŸ˜ŠπŸ”βœ¨

About

πŸ”βœ¨ Built a fun and secure Password Strength Meter app in Streamlit with password tips, emoji feedback, background image, and strong password generator! πŸ’»πŸ›‘οΈπŸŽ²

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages