@jihyunlab/web-secure-storage
JihyunLab Web secure storage.
Web secure storage can be used by web applications such as React.
Web secure storage encrypts values and stores them in local or session storage. When getting stored values, they are decrypts back to their original values.
Web Secure Storage provides encryption with AES(Advanced Encryption Standard) 256 CBC and Triple-DES 256 CBC.
Additionally, PBKDF2(Password-Based Key Derivation Function 2) and PKCS#7 are used for encryption. Also, since a random iv (Initialization Vector) value is used for encryption, the value cannot be easily inferred.
Requirements
Node.js
Setup
Setup regular JihyunLab Web secure storage
npm i @jihyunlab/web-secure-storage
or
yarn add @jihyunlab/web-secure-storage
Usage
import { SecureStorage, STORAGE, CRYPTO } from '@jihyunlab/web-secure-storage'
const storage = SecureStorage(STORAGE.LOCAL, CRYPTO.AES, 'your secret key', 128 /* The number of iterations for PBKDF2 */);
storage.clear();
storage.setItem('item', 'value');
storage.getItem('item');
storage.removeItem('item');
Credits
Authored and maintained by JihyunLab <info@jihyunlab.com>
License
Open source licensed as MIT.