ionic2 - Encryption with Ionic 2 -
i looking implement encrypt/decrypt functionality in ionic 2 app. looking simple, work ionic 2.
please can recommend library/plugin works ionic 2?
i have tried few libraries, cannot them work in ionic 2. have issues import ionic 2.
e.g.
using js-jose, following error:
typeerror: argument 3 of subtlecrypto.wrapkey not implement interface cryptokey
using crypto-js, following error:
for storing data on device, can switch secure storage cordova plugin instead of insecure localstorage. note android, need have either pin or swipe screen lock set make work.
ionic add plugin cordova-plugin-secure-storage
dont forget wrap plugin inside platform.ready()
constructor(public platform: platform) { platform.ready().then(() => { this.securestorage = new securestorage(); this.securestorage.create('demoappstorage').then( () => { console.log('securestorage ready!'); }, error => console.log(error) ); });
Comments
Post a Comment