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.
- 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.
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])
- Node.js (v18 or higher)
- NPM (v9 or higher)
Clone the repository and install dependencies:
git clone https://github.com/itsPremkumar/multilayer-encryption-framework.git
cd multilayer-encryption-framework
npm installInitialize your unique cryptographic landscape:
npm run keysCaution
Back up your keys.json. If this file is lost, any data encrypted with it becomes permanently inaccessible.
Encrypting Data:
npm run encryptDecrypting Data:
npm run decryptThe framework includes a high-integrity test suite for cryptographic validation:
npm run testContributions 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.
Distributed under the MIT License. See LICENSE for more information.
Prem Kumar
- GitHub: @itsPremkumar
- Project: Multilayer Encryption Framework
If you find this project useful, please consider giving it a ⭐ on GitHub!