This project implements a text encryption and decryption system using symmetric cryptography. It ensures unique ciphertext outputs for identical inputs by using a random IV and salt.
- AES-256-CBC (Symmetric Encryption)
- Encrypts user text securely
- Decrypts encrypted text
- Uses random IV and salt
- Same input produces different encrypted output
- Node.js (Crypto module)
- Dotenv (Environment Management)
- User provides plaintext and password
- A random salt is generated
- A random IV is generated
- AES-256-CBC encrypts the data
- Encrypted text is returned
- Symmetric Encryption Basics: Utilized the AES-256-CBC algorithm for high-security data protection.
- IV/Nonce Handling: Implemented a random Initialization Vector (IV) for every encryption process. This ensures that the same plaintext input results in a unique ciphertext output every time.
- Secure Key Storage: Used environment variables (`.env`) and `.gitignore` to prevent sensitive cryptographic keys from being exposed in source control.
- Clone the repository.
- Run `npm install` to install dependencies (`express`, `dotenv`).
- Create a `.env` file in the root directory and add: `ENCRYPTION_KEY=your_32_character_secret_key_here`
- Run `node app.js` to see the encryption/decryption in action.
EOF