1.0.3 • Published 9 months ago

ifo-encrypt-decrypt-js v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

Encrypt Decrypt Service

A simple encryption and decryption service using AES-256 with CryptoJS.

Installation

npm i ifo-encrypt-decrypt-js

#USAGE

import EncryptDecryptService from 'ifo-encrypt-decrypt-js';


// Encrypt data
const encrypted = EncryptDecryptService.encryptData({ foo: 'bar' });
console.log('Encrypted:', encrypted);

// Decrypt data
const decrypted = EncryptDecryptService.decryptData(encrypted);
console.log('Decrypted:', decrypted);

Using Custom Key and IV from Environment Variables

By default, the package comes with built-in keys for AES encryption. However, you can specify your own custom AES key and IV through environment variables.

In your .env file, set the following:

AES_KEY="your-custom-32-character-aes-key" # Must be 32 characters long for AES-256
AES_IV="your-custom-16-character-aes-iv"   # Must be 16 characters long for the IV
1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago