Secure Data
secure-data takes care of storing the local storage data securely by encrypting all the data (basically it is a wrapper written over the default localStorage to write the data securely to the localStorage) and storing it in memory this for faster reading.
The key is generated using the browser fingerprint which is generated using more than 10 browser key identifiers and the secure key entered by the user.
The user specific secure key can be configured using the .env file as CS_HASH=xxxxxxxxxxxxxxxx or CS_HASH_KEY=xxxxxxxxx
In addition, secure-data storage preserves the data format for each data type, as it supports the following data types.
String | Object | Object | Number | Boolean
🛠️ Installation Steps:
1. Install with npm
npm i secure-data
2. Install with yarn
yarn add secure-data
3. Import
import secureData as SD from 'secure-data'
Function | Usecase | Datatype |
---|---|---|
setItem(key, value) |
To set values to secure storage | Supports 'String - Object - Number - Boolean' as value |
getItem(key) |
To get values which is saved on secure local storage | Return null if the key does not exits |
removeItem(key) |
To remove specified key from secure local storage | |
clear() |
Removed all data from secure local storage |