Skip to content
/ SHAES Public

Lightweight python script for encrypting and decrypting files using AES in CBC mode

License

Notifications You must be signed in to change notification settings

stigsec/SHAES

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

SHAES

SHAES is a lightweight Python script for encrypting and decrypting files using AES encryption in CBC mode.


Features

  • Encryption: Securely encrypt files with a password.
  • Decryption: Decrypt previously encrypted files.
  • Error Handling: Alerts for incorrect passwords, non-encrypted files, or missing files.
  • Lightweight: Minimal dependencies and easy to use.

Getting Started

Dependencies

Ensure you have Python 3 installed along with the required library:

pip install pycryptodome

Installation

  1. Clone the repository:

    git clone https://github.com/stigsec/SHAES.git
  2. Navigate to the project directory:

    cd SHAES

Usage

Syntax

python shaes.py {enc/dec} {input_file} {password}

Examples

Encrypt a file:

python shaes.py enc myfile.txt mypassword

This will create an encrypted file named myfile.txt.shase.

Decrypt a file:

python shaes.py dec myfile.txt.shase mypassword

This will create a decrypted file named myfile.txt.


How It Works

  1. Key Derivation: Uses SHA-256 to derive a secure key from the provided password.
  2. AES Encryption: Encrypts data using AES in CBC mode with a randomly generated initialization vector (IV).
  3. Padding: Ensures data alignment with AES block size using PKCS7 padding.
  4. Error Handling: Detects invalid files or decryption attempts with incorrect passwords.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for more details.


Developed by stigsec.

About

Lightweight python script for encrypting and decrypting files using AES in CBC mode

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages