Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlashCrypt

A simple file encryption/decryption tool using password-based encryption with AES-256.

FlashCrypt Demo

⚠️ WARNING

IMPORTANT - READ BEFORE USE:

  • This tool PERMANENTLY encrypts/decrypts files - original files are deleted after processing
  • Lost passwords CANNOT be recovered - there is no backdoor or password reset
  • Keep the .encryption_salt file safe - deleting it makes decryption impossible
  • Test with non-critical files first to understand how it works
  • Always keep backups of important files before encrypting
  • Use strong passwords - weak passwords compromise security
  • The tool processes ALL files recursively in the directory and subdirectories

Features

  • 🔒 Strong encryption using PBKDF2 and Fernet (AES-256)
  • 📁 Recursive directory encryption/decryption
  • 🔑 Password-based encryption with salt management
  • 🖥️ Cross-platform support (Windows, macOS, Linux)
  • 📦 Standalone executables - no Python installation required

Quick Start

Option 1: Using Pre-built Executable (Recommended for End Users)

  1. Download the executable for your platform:

    • Windows: FlashCrypt.exe
    • macOS/Linux: FlashCrypt
  2. Place the executable in the folder containing files you want to encrypt/decrypt

  3. Run the executable:

    • Windows: Double-click FlashCrypt.exe
    • macOS/Linux: Open terminal and run ./FlashCrypt
  4. Follow the prompts:

    • Select option 1 to encrypt files
    • Select option 2 to decrypt files
    • Select option 3 to exit
    • Enter your password when prompted
    • Type yes to confirm the operation

Note: The executable is completely standalone - no Python installation needed!

Option 2: Using Python Script (For Developers)

Requirements

  • Python 3.7 or higher
  • pip package manager

Installation

  1. Clone or download this repository

  2. Install dependencies:

    pip install -r requirements.txt

Running the Script

  1. Navigate to the directory with files you want to encrypt/decrypt:

    cd /path/to/your/files
  2. Copy script.py to that directory

  3. Run the script:

    python script.py
  4. Follow the interactive prompts as described above

Building Your Own Executable

If you want to build the executable yourself from source:

Step 1: Install Python and Dependencies

  1. Install Python 3.7+ from python.org

  2. Install required packages:

    pip install -r requirements.txt

Step 2: Build the Executable

Automatic build (recommended):

python build.py

Manual build (alternative):

pip install pyinstaller
pyinstaller --onefile --name=FlashCrypt --console script.py

Step 3: Find Your Executable

The executable will be created in the dist/ directory:

  • Windows: dist/FlashCrypt.exe
  • macOS/Linux: dist/FlashCrypt

You can now distribute this standalone executable - recipients don't need Python installed!

How It Works

Encryption Process

  1. Tool scans the directory for all files (recursively through subdirectories)
  2. Skips itself, the salt file, and system files (.dll, .pyd, etc.)
  3. Creates a hidden .encryption_salt file if it doesn't exist
  4. Derives encryption key from your password using PBKDF2 (100,000 iterations)
  5. Encrypts each file using Fernet (AES-256 in CBC mode)
  6. Adds .encrypted extension to encrypted files
  7. Deletes original unencrypted files

Decryption Process

  1. Tool finds all .encrypted files in the directory
  2. Uses existing .encryption_salt file
  3. Derives decryption key from your password
  4. Decrypts each .encrypted file
  5. Restores original filenames (removes .encrypted extension)
  6. Deletes encrypted files

Files Excluded from Encryption

  • The FlashCrypt executable itself
  • .encryption_salt file
  • System libraries (.dll, .pyd, .so, .dylib)
  • Already encrypted files (.encrypted extension)

Security Features

  • AES-256 Encryption: Industry-standard symmetric encryption
  • PBKDF2 Key Derivation: 100,000 iterations with SHA-256
  • Random Salt: 16-byte random salt per directory
  • No Key Storage: Password is never stored, only used in memory
  • Salt Protection: Salt file is hidden on Windows

Important Notes

Password Management

  • Choose a strong password (mix of letters, numbers, symbols)
  • Remember your password - it cannot be recovered
  • Use the same password for encrypting and decrypting
  • Don't share passwords over insecure channels

Salt File (.encryption_salt)

  • Automatically created on first encryption
  • Hidden file (invisible on Windows by default)
  • Must stay with encrypted files - don't delete it
  • Losing this file means permanent data loss
  • Back it up with your encrypted files if moving them

File Operations

  • Original files are permanently deleted after encryption
  • Encrypted files are permanently deleted after decryption
  • Always test with copies of important files first
  • Keep backups elsewhere before encrypting

Best Practices

  • ✅ Test with non-critical files first
  • ✅ Keep backups of important data
  • ✅ Use strong, unique passwords
  • ✅ Store password in a password manager
  • ✅ Keep .encryption_salt file with encrypted files
  • ❌ Don't encrypt files without backups
  • ❌ Don't lose your password
  • ❌ Don't delete the .encryption_salt file
  • ❌ Don't use weak passwords

Troubleshooting

"No files to encrypt"

  • Files are already encrypted, or
  • No files exist in the directory except the executable

"Decryption failed. Wrong password or corrupted file"

  • Incorrect password entered
  • .encryption_salt file is missing or incorrect
  • File was corrupted after encryption
  • File was encrypted with a different password/salt

Console window closes immediately

  • This shouldn't happen anymore - the tool waits for Enter key
  • If it does, run from command prompt/terminal to see errors

Files not showing up for encryption

  • Check if they're already encrypted (.encrypted extension)
  • Ensure they're not system files (.dll, .pyd, etc.)
  • Make sure you're in the correct directory

macOS: "Apple could not verify that this app is free of malware"

macOS Gatekeeper blocks unsigned apps by default. To run FlashCrypt:

Option 1: Right-click method

  1. Right-click (or Control+click) on FlashCrypt-macOS
  2. Select "Open" from the menu
  3. Click "Open" in the dialog that appears
  4. You only need to do this once

Option 2: Terminal method

# Remove quarantine attribute
xattr -d com.apple.quarantine FlashCrypt-macOS

# Make executable
chmod +x FlashCrypt-macOS

# Run it
./FlashCrypt-macOS

Option 3: System Settings

  1. Try to open the app (it will be blocked)
  2. Go to System Settings → Privacy & Security
  3. Scroll down and click "Open Anyway" next to the FlashCrypt message
  4. Confirm by clicking "Open"

Linux: "Permission denied"

Make the file executable:

chmod +x FlashCrypt-Linux
./FlashCrypt-Linux

Disclaimer

This tool is provided "as is" without warranty of any kind. Use at your own risk. Always maintain backups of important data.

About

A simple file encryption/decryption tool using password-based encryption with AES-256.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages