This project demonstrates how to implement Advanced Encryption Standard (AES) encryption and decryption in Node.js using the crypto
module. It allows encrypting and decrypting files, such as images, using AES-256-CBC mode.
- AES-256 Encryption: Uses 256-bit keys for robust encryption.
- File Encryption & Decryption: Can encrypt and decrypt files like
.jpg
,.jpeg
,.png
, or any other file type. - Dynamic Key Generation: Generates a new random key for each encryption.
- Node.js
- npm (or yarn)
-
Clone the repository:
git clone https://github.com/anuuragg/AES-in-Node.js.git cd AES-in-Node.js
-
Install the necessary dependencies:
npm install
Run the encryption script to encrypt a file. The encrypted file will be stored in the encrypted_files
folder.
node src/encryption/encrypt.js
Run the decryption script to decrypt an encrypted file. The decrypted file will be stored in the decrypted_files
folder.
node src/encryption/decrypt.js