crypt-hpulido
v1.0.5
Published
Encrypt and decrypt data using your own key
Downloads
28
Readme
crypto-hpulido
Encrypt and decrypt data using AES encryption with this lightweight TypeScript library.
Installation
npm install crypto-hpulido
Usage
import { aesEncrypt, aesDecrypt } from 'crypto-hpulido';
// Encrypt a plain text
const plaintext = 'Hello, world!';
const ciphertext = await aesEncrypt(plaintext, 'key');
// Decrypt the ciphertext
const decryptedText = await aesDecrypt(ciphertext, 'key');
console.log('Original Text:', plaintext);
console.log('Encrypted Text:', ciphertext);
console.log('Decrypted Text:', decryptedText);
Note:
AES key data must be 128 or 256 bits. Ensure that your encryption key meets this requirement.
Contributing
Feel free to contribute to this project. If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.