Fuzzu Image Encryptor | Python GUI to Encrypt & Decrypt Images Securely (Offline)
Demo :
Click Video πππ
π Description:
Build your own Image Encryption Tool in Python! With a sleek dark GUI and powerful Fernet encryption, this app secures your images in just one click. Designed for coders, tech lovers, and anyone who values privacy. Try the app, grab the code, and enhance your cyber toolkit today. π»π
Build your own Image Encryption Tool in Python! With a sleek dark GUI and powerful Fernet encryption, this app secures your images in just one click. Designed for coders, tech lovers, and anyone who values privacy. Try the app, grab the code, and enhance your cyber toolkit today. π»π
π Features:
-
π 1-click Encrypt/Decrypt for JPG/PNG
-
π» Built with customtkinter + Fernet
-
π️ Save your key securely
-
π₯ Dark mode GUI
-
π― Works fully offline
Code :
import customtkinter as ctk
from tkinter import filedialog, messagebox
from PIL import Image
from cryptography.fernet import Fernet
import base64
import os
ctk.set_appearance_mode("dark")
ctk.set_default_color_theme("blue")
class ImageEncryptorApp(ctk.CTk):
def __init__(self):
super().__init__()
self.title("Fuzzu Encrypt/Decrypt Image Tool")
self.geometry("600x500")
self.resizable(False, False)
self.key = Fernet.generate_key()
self.cipher = Fernet(self.key)
self.init_gui()
def init_gui(self):
ctk.CTkLabel(self, text="Image Encryptor & Decryptor", font=("Arial", 24, "bold")).pack(pady=20)
self.encrypt_button = ctk.CTkButton(self, text="π Encrypt Image", command=self.encrypt_image)
self.encrypt_button.pack(pady=15)
self.decrypt_button = ctk.CTkButton(self, text="π Decrypt Image", command=self.decrypt_image)
self.decrypt_button.pack(pady=15)
self.save_key_button = ctk.CTkButton(self, text="πΎ Save Key", command=self.save_key)
self.save_key_button.pack(pady=15)
self.status_label = ctk.CTkLabel(self, text="Status: Ready", text_color="gray")
self.status_label.pack(pady=20)
def encrypt_image(self):
file_path = filedialog.askopenfilename(filetypes=[("Image Files", "*.png *.jpg *.jpeg *.bmp")])
if file_path:
with open(file_path, "rb") as img_file:
image_data = img_file.read()
encrypted_data = self.cipher.encrypt(image_data)
encrypted_file_path = file_path + ".fuzzu"
with open(encrypted_file_path, "wb") as enc_file:
enc_file.write(encrypted_data)
self.status_label.configure(text=f"Encrypted: {os.path.basename(encrypted_file_path)}")
def decrypt_image(self):
file_path = filedialog.askopenfilename(filetypes=[("Encrypted Files", "*.fuzzu")])
if file_path:
try:
with open(file_path, "rb") as enc_file:
encrypted_data = enc_file.read()
decrypted_data = self.cipher.decrypt(encrypted_data)
decrypted_file_path = file_path.replace(".fuzzu", "_decrypted.png")
with open(decrypted_file_path, "wb") as dec_file:
dec_file.write(decrypted_data)
self.status_label.configure(text=f"Decrypted: {os.path.basename(decrypted_file_path)}")
except Exception as e:
messagebox.showerror("Error", "Decryption failed. Check the key or file.")
self.status_label.configure(text="Status: Decryption Failed")
def save_key(self):
file_path = filedialog.asksaveasfilename(defaultextension=".key", filetypes=[("Key Files", "*.key")])
if file_path:
with open(file_path, "wb") as key_file:
key_file.write(self.key)
self.status_label.configure(text=f"Key saved: {os.path.basename(file_path)}")
if __name__ == "__main__":
app = ImageEncryptorApp()
app.mainloop()
Comments
Post a Comment