Skip to content

itsPremkumar/multilayer-encryption-framework

🛡️ Multilayer Encryption Framework

License: MIT TypeScript Security Grade PRs Welcome

A high-performance, multilayered cryptographic pipeline built in TypeScript. This framework combines industry-standard symmetric encryption (AES-256-GCM) with advanced security measures like HKDF key separation, PBKDF2/Scrypt key stretching, and dynamic obfuscation layers to create an incredibly resilient encryption pipeline.


🚀 Key Features

  • AES-256-GCM Backbone: Authenticated encryption for confidentiality and integrity.
  • Advanced Key Stretching: Uses 100,000+ rounds of PBKDF2 or memory-hard Scrypt.
  • HKDF Key Separation: Independent derivation of encryption and signing keys.
  • Dynamic Multi-layered Pipeline:
    • Substitution Layer: Randomized character mapping.
    • Caesar Shuffle: Key-driven character shifting.
    • Rail Fence Layer: Transposition obfuscation.
    • Affine Math Layer: Modular algebraic byte transformation.
  • Chaos Round Logic: Deterministic, key-dependent round randomization.
  • Systematic Obfuscation: Unique algorithm landscape per deployment via keys.json.

🏗️ Technical Architecture

This framework operates on a modular pipeline architecture. Every deployment is geographically and logically unique based on the cryptographically randomized keys.json.

graph TD
    User([User Input]) --> Key[Secret Key]
    User --> Plain[Plaintext]
    
    Config[keys.json] --> Mapping[Alphabet Maps]
    Config --> Salts[System Salts]
    
    subgraph "Hardened KDF"
        Key --> Stretch[Scrypt / PBKDF2]
        Salts --> Stretch
        Stretch --> MasterKey[Master Key]
        MasterKey --> HKDF[HKDF Expansion]
        HKDF --> AESKey[AES-256 Key]
        HKDF --> HMACKey[HMAC Key]
    end
    
    subgraph "The Pipeline"
        Plain --> Padding[Dynamic Padding]
        Padding --> Chaos[Chaos Layer: N Rounds]
        Chaos --> AES[AES-256-GCM]
        AES --> HMAC[HMAC-SHA384]
    end
    
    HMAC --> Output([Base64 JSON Payload])
Loading

⚙️ Requirements

  • Node.js (v18 or higher)
  • NPM (v9 or higher)

💻 Quick Start

1. Installation

Clone the repository and install dependencies:

git clone https://github.com/itsPremkumar/multilayer-encryption-framework.git
cd multilayer-encryption-framework
npm install

2. Security Setup

Initialize your unique cryptographic landscape:

npm run keys

Caution

Back up your keys.json. If this file is lost, any data encrypted with it becomes permanently inaccessible.

3. Usage

Encrypting Data:

npm run encrypt

Decrypting Data:

npm run decrypt

🧪 Testing

The framework includes a high-integrity test suite for cryptographic validation:

npm run test

🤝 Contributing

Contributions make the open-source community an amazing place to learn and create. Any contributions you make are greatly appreciated. Please read our CONTRIBUTING.md for details.


📜 License

Distributed under the MIT License. See LICENSE for more information.

👤 Author

Prem Kumar


If you find this project useful, please consider giving it a ⭐ on GitHub!

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors