DEV Community

Mate Technologies
Mate Technologies

Posted on

πŸ” FileCryptor – Secure File & Folder Encryption Tool (Python + GUI)

If you’ve ever needed a simple, secure way to encrypt files and folders, this project might be exactly what you’re looking for.

Introducing FileCryptor β€” a modern Python desktop app that lets you encrypt and decrypt files with strong password-based security, all wrapped in a clean GUI.

πŸ‘‰ Get it here: https://gum.new/gum/cmkncobmj001h04jr8ecl39l9

πŸš€ What is FileCryptor?

FileCryptor is a desktop encryption tool built with:

🐍 Python
πŸ–Ό Tkinter + ttkbootstrap UI
πŸ” cryptography library (Fernet + PBKDF2HMAC)

It allows you to:

Encrypt files & folders recursively
Decrypt them safely with the same password
Use drag & drop for fast workflows
Monitor progress in real time
πŸ”‘ Why This Tool Matters

Security tools are often:

Too complex ❌
Too technical ❌
Or just ugly ❌

FileCryptor focuses on:

βœ” Simplicity
βœ” Strong encryption
βœ” Clean UI
βœ” Real usability

πŸ” How Encryption Works

This tool uses industry-standard cryptography:

  1. Password-Based Key Derivation Uses PBKDF2HMAC (SHA-256) 390,000 iterations Adds strong resistance against brute-force attacks
  2. Random Salt Per File Each file gets a unique 16-byte salt Prevents identical files from producing identical outputs
  3. Secure Encryption Uses Fernet (AES-based encryption) Ensures confidentiality + integrity ✨ Key Features πŸ“ Encrypt Entire Folders Recursively processes all files No need to manually select each file πŸ–± Drag & Drop Support Just drop files/folders into the app Instant queueing πŸ” Password Protection Password confirmation dialog Strength indicator: Weak Medium Strong ⏱ Real-Time Progress Progress bar + logs Smooth UI thanks to threading ❌ Cancel Anytime Stop long operations safely 🧹 Clean Logs Built-in log viewer Clear logs with one click πŸ’‘ Example Workflow Drag a folder into FileCryptor Click Encrypt Files/Folders Enter a strong password Files are encrypted with .enc extension

Later:

Select encrypted files
Click Decrypt
Enter the same password
Files are restored πŸŽ‰
🧠 Smart Design Choices
πŸ”„ Multithreading

Keeps the UI responsive during long operations.

πŸ” Recursive File Handling

Automatically processes nested directories.

πŸ›‘ Safe Decryption
Skips invalid files
Prevents crashes on corrupted data
πŸ“¦ Supported Files

Short answer: everything.

You can encrypt:

πŸ“„ Documents (PDF, DOCX, TXT)
πŸ–Ό Images (PNG, JPG)
🎡 Media (MP3, MP4)
πŸ’» Code (PY, JSON, CSV)

If it’s a file β†’ it works.

πŸ›  Tech Stack
Python 3
Tkinter
ttkbootstrap
cryptography
tkinterdnd2
πŸ”₯ Code Highlights
Secure Key Derivation

def derive_key(password: str, salt: bytes) -> bytes:
    kdf = PBKDF2HMAC(
        algorithm=hashes.SHA256(),
        length=32,
        salt=salt,
        iterations=390_000,
        backend=default_backend()
    )
    return base64.urlsafe_b64encode(kdf.derive(password.encode()))
Enter fullscreen mode Exit fullscreen mode

Encryption Flow

salt = os.urandom(16)
key = derive_key(password, salt)
fernet = Fernet(key)
encrypted_data = fernet.encrypt(data)
Enter fullscreen mode Exit fullscreen mode

Decryption Flow

salt = data[:16]
encrypted_data = data[16:]
key = derive_key(password, salt)
fernet = Fernet(key)
decrypted_data = fernet.decrypt(encrypted_data)
Enter fullscreen mode Exit fullscreen mode

⚠️ Important Notes
πŸ”‘ If you lose your password β†’ your data is gone
There is no recovery mechanism (by design, for security)
πŸ“₯ Get FileCryptor

πŸ‘‰ Download here:
https://gum.new/gum/cmkncobmj001h04jr8ecl39l9

πŸ’¬ Final Thoughts

FileCryptor is a great example of how you can combine:

Security πŸ”
Usability πŸ§‘β€πŸ’»
Clean UI 🎨

…into a practical tool people can actually use.

If you're building Python desktop apps, this project is also a solid reference for:

Tkinter architecture
Threading patterns
Real-world cryptography usage

Top comments (0)