Skip to content

Lightweight encryption/decryption tool with both GUI and CLI support. Built with Python & Flask.

License

Notifications You must be signed in to change notification settings

aman-sharma-dev/pycryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” PyCryption

Current Version: 1.0.0

A powerful file, text, and folder encryption tool with a Flask-powered web UI, a Python GUI, and a command-line interface (CLI). Supports key management, password-based encryption, and multiple encryption methods.

Python Flask License Build


πŸ“‚ Project Structure

Click to expand
.
β”œβ”€β”€ app
β”‚   β”œβ”€β”€ web_ui
β”‚   β”‚   β”œβ”€β”€ templates
β”‚   β”‚   β”‚   β”œβ”€β”€ base.html
β”‚   β”‚   β”‚   β”œβ”€β”€ file_encryption.html
β”‚   β”‚   β”‚   β”œβ”€β”€ index.html
β”‚   β”‚   β”‚   └── text_encryption.html
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ forms.py
β”‚   β”‚   └── routes.py
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ cli.py
β”‚   └── crypto_utils.py
β”œβ”€β”€ assets
β”‚   └── favicon.ico
β”œβ”€β”€ instance
β”œβ”€β”€ tests
β”‚   └── tests.py
β”œβ”€β”€ .env
β”œβ”€β”€ .env.example
β”œβ”€β”€ .gitignore
β”œβ”€β”€ config.py
β”œβ”€β”€ devserver.sh
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ gui.py
β”œβ”€β”€ main.py
β”œβ”€β”€ PyCryption.spec
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ run.py
└── wsgi.py

⚑ Features

  • πŸ”‘ Key Management: persistent keys, load/save keys, password-based keys
  • πŸ“ Text Encryption/Decryption: available in GUI, CLI, Web UI
  • πŸ“‚ File & Folder Encryption/Decryption: using Fernet keys or passwords
  • 🌐 Flask Web UI: browser-based, user-friendly interface
  • πŸ–₯ Tkinter-based GUI App for non-technical users
  • πŸ›  CLI Tools for developers and scripting
  • πŸ”’ Demo Ciphers (Caesar Cipher and more)

πŸš€ Getting Started

1. Environment Setup

Create and activate a Python virtual environment:

python -m venv .venv
source .venv/bin/activate   # Linux/macOS
.venv\Scripts\activate      # Windows

Install dependencies:

pip install -r requirements.txt

2. Running the Web Application

Development server:

./devserver.sh

Production (Gunicorn):

gunicorn --bind 0.0.0.0:8080 wsgi:app

3. Running the GUI

python gui.py

Main Features:

  • Generate & manage encryption keys
  • Encrypt/Decrypt text
  • Encrypt/Decrypt files
  • Persistent key storage

4. Command-Line Interface (CLI)

Activate your venv, then use:

flask encryptor --help

πŸ”‘ Key Management

# Generate random key β†’ secret.key
flask encryptor generate-key

# Derive key from password
flask encryptor generate-key --from-password "my_strong_password"

πŸ“ Text Encryption/Decryption

flask encryptor encrypt-text "My secret message"
flask encryptor decrypt-text "gAAAAABl..."

# Supports --key or --password overrides

πŸ“‚ File Encryption/Decryption

flask encryptor encrypt-file path/to/file.txt
flask encryptor decrypt-file path/to/file.txt.enc

πŸ“ Folder Encryption/Decryption

flask encryptor encrypt-folder path/to/folder --password "mypassword"
flask encryptor decrypt-folder path/to/encrypted_folder --password "mypassword"

πŸ”‘ Caesar Cipher (Demo)

flask encryptor caesar "Hello World" 3

5. Running Tests

pytest

6. Building Executables (PyInstaller)

Create a standalone executable:

pyinstaller --onefile --windowed --add-data "assets;assets" gui.py

Executable will be in the dist/ folder.


βš™οΈ Configuration

  • config.py: application defaults
  • instance/config.py: environment-specific (ignored in git)

Switch environment:

export FLASK_CONFIG=production

πŸ“Œ Roadmap

  • AES/GCM encryption support
  • Cloud key vault integration
  • Docker deployment examples
  • WebSocket-based live encryption demo

🀝 Contributing

  • Fork the project
  • Create your feature branch: git checkout -b feature/amazing-feature
  • Commit your changes: git commit -m 'Add amazing feature'
  • Push to the branch: git push origin feature/amazing-feature
  • Open a Pull Request

πŸ“œ License

Distributed under the MIT License. See LICENSE for details.


✨ Acknowledgements

  • Flask
  • PyInstaller
  • cryptography

About

Lightweight encryption/decryption tool with both GUI and CLI support. Built with Python & Flask.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages