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:

javascript library of crypto standards implementation

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

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

Popular posts from this blog

sql - can we replace full join with union of left and right join? why not? -

javascript - Parallax scrolling and fixed footer code causing width issues -

iOS: Performance of reloading UIImage(name:...) -