1.0.4 • Published 3 years ago

rn_encrypted_storage v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

RN-Encrypted-Storage :

A react native package to securely store data locally, it adds to AsyncStorage an encryption layer based on AES and Hmacsha1 encryption algorithms, your data is now saved 100% encrypted.

Installation :

npm install rn_encrypted_storage
# or 
yarn add rn_encrypted_storage

## Install the peer-dependencies if your npm is between v3 and v7: 
npm i @react-native-async-storage/async-storage hmacsha1 react-native-device-info react-native-crypto-js
# or with 
yarn add @react-native-async-storage/async-storage hmacsha1 react-native-device-info react-native-crypto-js

Usage :

import {encyptStorage,decryptStorage, removeEncryptStorage} from "rn_encrypted_storage";

...

const storeData=async(loggedUser)=>{
 await encryptStorage("name",loggedUser); // you don't need to stringify the object
}

...

const getData=()=>{
  decryptStorage("name").then(res=>{
    console.log(res) // this is your securely stored object, this retures it stringify so you can do :
    console.log(JSON.parse(res)) // if it's a json object
  }).catch(ex=>console.log(ex))
}

...

const remoteData=async ()=>{
  await remoteEncryptStorage("user");
}

Example

For example check the folder Example

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.1

3 years ago