Skip to content

Astrahan45/Cryptography

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cryptography — AES-256-GCM File Encryptor

CI Python License Tests

CLI tool for encrypting and decrypting files using AES-256-GCM with password-derived keys (PBKDF2 + SHA-256).


Features

  • AES-256-GCM authenticated encryption — detects tampering automatically
  • PBKDF2 key derivation with 200,000 iterations — brute-force resistant
  • Random salt + nonce per encryption — same file + password = different output every time
  • Simple CLI interface — encrypt and decrypt commands
  • Works on any file type (text, binary, images, archives)

Encrypted File Format

``` [MAGIC 4B][VERSION 1B][SALT 16B][NONCE 12B][TAG 16B][CIPHERTEXT ...] ```

The header embeds all parameters needed for decryption — no separate metadata file required.


Quick Start

```bash pip install -r requirements.txt python -m cryptor.cli encrypt secret.txt -o secret.txt.enc python -m cryptor.cli decrypt secret.txt.enc -o secret.txt ```


Project Structure

``` Cryptography/ ├── cryptor/ │ ├── crypto.py # AES-256-GCM core logic │ ├── cli.py # CLI interface (argparse) │ └── utils.py # Password prompt, path helpers ├── tests/ │ ├── test_crypto.py │ └── test_cli.py └── .github/workflows/ci.yml ```


Running Tests

```bash pytest tests/ -v

7 passed

```


Security Notes

Property Implementation
Cipher AES-256-GCM (authenticated)
Key derivation PBKDF2-SHA256, 200,000 iterations
Salt 16 bytes, random per encryption
Nonce 12 bytes, random per encryption
Authentication tag 16 bytes, verified before decryption

Requirements

``` pycryptodome>=3.20.0 pytest>=8.0.0 ```


Author

Astrahan45 — Network Engineer · MSc Integrated Communications Systems

GitHub

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages