πŸ” PDF Password Protector Python App – FuzzuTech | Offline GUI with PyPDF2 + CustomTkinter

 Demo :


Click Video πŸ‘‡πŸ‘‡πŸ‘‡






























πŸ“Œ Description (Blogger Body):
Want to secure your PDF files like a pro hacker? Check out this stylish PDF Password Protector built using Python, customtkinter, and PyPDF2. This offline app lets you select a PDF, enter a password, and instantly lock it—all in one clean dark-themed GUI. Perfect for coders, cybersecurity learners, and productivity lovers. Watch the full video demo and download the code on our blog now.

πŸš€ Built by FuzzuTech – Bringing viral GUI projects to your screen!


πŸ“Œ Features:

  • Full dark mode GUI using customtkinter

  • Select & lock PDF with strong password

  • Offline & secure (no data upload)

  • Built in Python using PyPDF2, filedialog, and messagebox

  • Ideal for developers, students, or cyber tool enthusiasts


Code :


import customtkinter as ctk

from tkinter import filedialog, messagebox

import PyPDF2


# Configure appearance

ctk.set_appearance_mode("dark")

ctk.set_default_color_theme("blue")


# Main app window

app = ctk.CTk()

app.title("PDF Password Protector")

app.geometry("500x400")

app.resizable(False, False)


# Functions

def browse_pdf():

    file_path = filedialog.askopenfilename(filetypes=[("PDF Files", "*.pdf")])

    if file_path:

        entry_file.delete(0, ctk.END)

        entry_file.insert(0, file_path)


def protect_pdf():

    pdf_file = entry_file.get()

    password = entry_password.get()


    if not pdf_file or not password:

        messagebox.showwarning("Missing Info", "Please select a file and enter password.")

        return


    try:

        output_file = pdf_file.replace(".pdf", "_protected.pdf")

        reader = PyPDF2.PdfReader(pdf_file)

        writer = PyPDF2.PdfWriter()


        for page in reader.pages:

            writer.add_page(page)


        writer.encrypt(password)


        with open(output_file, "wb") as f:

            writer.write(f)


        messagebox.showinfo("Success", f"Protected PDF saved as:\n{output_file}")

    except Exception as e:

        messagebox.showerror("Error", f"Failed to protect PDF:\n{e}")


# GUI Layout

ctk.CTkLabel(app, text="πŸ” PDF Password Protector", font=("Segoe UI", 20, "bold")).pack(pady=20)


entry_file = ctk.CTkEntry(app, width=300, placeholder_text="Choose PDF File...")

entry_file.pack(pady=10)


btn_browse = ctk.CTkButton(app, text="Browse PDF", command=browse_pdf)

btn_browse.pack()


entry_password = ctk.CTkEntry(app, width=300, placeholder_text="Enter Password", show="*")

entry_password.pack(pady=20)


btn_protect = ctk.CTkButton(app, text="Protect PDF", command=protect_pdf, fg_color="#00b894", hover_color="#019875")

btn_protect.pack(pady=10)


ctk.CTkLabel(app, text="Made with ❤️ by FuzzuTech", font=("Segoe UI", 12)).pack(side="bottom", pady=10)


# Run the app

app.mainloop()

Comments

Popular posts from this blog

πŸš€ Simple Login & Registration System in Python Tkinter πŸ“±

πŸ”₯ Advanced MP3 Music Player in Python | CustomTkinter + Pygame | Free Source Code

πŸš€ Create a Python Screen Recorder with Audio (Complete Code)