encrystorage
v1.0.0
Published
A lightweight and secure solution for encrypting and decrypting sensitive data in the local storage of web browsers.
Downloads
8
Maintainers
Readme
encrystorage 🔗
About
The "encrystorage" package is a lightweight and secure solution for encrypting and decrypting sensitive data in the local storage of web browsers. It provides two simple yet powerful functions that enable developers to store and retrieve encrypted data securely.
Tech Stack
- TypeScript
- CryptoJS (for encryption and decryption)
Installation
Install the package via npm:
npm install encrystorage
How to Use
import SecureStorage from "encrystorage";
const encryptionKey = "your-secret-key";
const secureStorage = new SecureStorage(encryptionKey);
const sensitiveData = "sensitive information";
secureStorage.encryptAndSave(sensitiveData);
// Later, retrieve and decrypt the data
const decryptedData = secureStorage.getAndDecrypt();
console.log(decryptedData); // Output: 'sensitive information'