Skip to content

Easy install and use for Cryption sensetive info. Enjoy a simple yet secure method to encrypt and decrypt files using the AES-256-CBC algorithm with password protection.

Notifications You must be signed in to change notification settings

ruslanlap/encrypt-decrypt-git-python

Repository files navigation

🔐 CRYPTONIT

Secure File Encryption Made Simple

License: MIT Bash OpenSSL

FeaturesQuick StartInstallationUsageSecurity


🌟 Overview

CRYPTONIT is a powerful yet user-friendly file encryption tool that uses AES-256-CBC encryption to secure your sensitive files. With both interactive and command-line interfaces, it provides military-grade encryption with a simple user experience.

👍 Features

  • 🔒 Military-grade Security: AES-256-CBC encryption with PBKDF2
  • 🖥️ Dual Interface: Interactive and command-line modes
  • 🎨 Modern UI: Colorful interface with progress indicators
  • 🪚 Auto-cleanup: Secure handling of temporary files
  • 🛠️ Cross-platform: Works on Linux, macOS, and Windows
  • 🛡️ Password Protection: Secure password-based encryption
  • 📁 Smart Naming: Automatic encrypted file management

📄 Table of Contents

📆 Requirements

  • Python 3.6 or higher
  • OpenSSL library

🔄 Quick Install

# Latest Stable Version
curl -sSL https://raw.githubusercontent.com/ruslanlap/encrypt-decrypt-git-python/master/install.sh | bash

# Latest Test Version (with enhanced UI)
curl -sSL https://raw.githubusercontent.com/ruslanlap/encrypt-decrypt-git-python/test/install.sh | bash

⚙️ Installation

Ubuntu/Debian

sudo apt update
sudo apt install openssl

CentOS/RHEL

sudo yum install openssl

macOS

brew install openssl

Windows

For Windows, you can download OpenSSL binaries from the official OpenSSL website here.

🔐 Security Features

  • AES-256-CBC encryption algorithm
  • PBKDF2 key derivation
  • Secure password handling
  • Automatic temporary file cleanup
  • No password storage

🎯 Examples

Basic Encryption

# Interactive Mode
cryptonit
> Choose operation: encrypt
> Enter file path: document.pdf
> Enter password: [hidden]
✅ Created: document.pdf_crypt

# Command Line Mode
cryptonit encrypt document.pdf

📝 Easy Usage

Just follow the workflow:

cryptonit
  • 🔑 Enter password for AES-256-CBC encryption (or press Enter to use hardcoded)
  • Choose the operation (encrypt/decrypt or e/d)
  • Enter the input file name

💡 Example

Encrypt a file:

cryptonit
  • 🔑 Enter password for AES-256-CBC encryption (password is hidden)
  • Choose the operation (encrypt/decrypt or e/d): e
  • Enter the input file name: my_secret_file.txt

This will encrypt the file my_secret_file.txt and create a new file named my_secret_file.txt_crypt.

📝 Alternative Usage

Add arguments after ./encrypt.sh or python encrypt.py:

./encrypt.sh [encrypt|decrypt] <inputfile>
  • encrypt: Encrypts the specified file.
  • decrypt: Decrypts the specified file.
  • <inputfile>: The path to the file you want to encrypt or decrypt.

Example

Encrypt a file:

./encrypt.sh encrypt my_secret_file.txt

This will encrypt the file my_secret_file.txt and create a new file named my_secret_file.txt_crypt.

🔒 Security Considerations

  • Hardcoded Password: This script includes a commented-out section for a hardcoded password. Do not use this option! Always prompt the user for a password at runtime.
  • Password Strength: Choose a strong and unique password for encryption.
  • Script Permissions: Ensure this script has appropriate permissions to be executed.

🔍 How it Works

  1. The script prompts the user for a password for encryption.
  2. It checks for at least two arguments (operation and input file).
  3. Based on the operation (encrypt/decrypt):
    • Encryption:
      • Extracts the filename without the path.
      • Generates an output filename with the _crypt suffix.
      • Uses openssl enc with AES-256-CBC, salt, and PBKDF2 for password derivation.
    • Decryption:
      • Checks if the input filename ends with _crypt.
      • Generates an output filename by removing the _crypt suffix.
      • Uses openssl enc -d to decrypt the file.
  4. The script displays a success or failure message based on the operation result.
  5. Finally, it clears the password variable from memory for security reasons.

🐟 encrypt.py

The encrypt.py script offers the same functionality as the Bash script, enabling file encryption and decryption using the AES-256-CBC algorithm. It provides a Python-based alternative for users who prefer or require Python for their workflow.

Usage

python encrypt.py [encrypt|decrypt] <inputfile>
  • encrypt: Encrypts the specified file.
  • decrypt: Decrypts the specified file.
  • <inputfile>: The path to the file you want to encrypt or decrypt.

Example

Encrypt a file:

python encrypt.py encrypt my_secret_file.txt

This will encrypt the file my_secret_file.txt and create a new file named my_secret_file.txt_crypt.

⚠️ Disclaimer

This tool is provided for educational and legitimate use only. Users are responsible for complying with local encryption laws and regulations.

Made with ❤️ by ruslanlap

About

Easy install and use for Cryption sensetive info. Enjoy a simple yet secure method to encrypt and decrypt files using the AES-256-CBC algorithm with password protection.

Resources

Stars

Watchers

Forks

Packages

No packages published