Encryption file angularjs

hello there… how to encryp file with angularjs or cordova plugin?

i found something https://github.com/disusered/cordova-safe and i got error cordova is not defined. maybe another way to encrypt file with angularjs

thx :slightly_smiling:

anyone can help this problem?

Try in an emulator or on a physical device.

how about a error? ReferenceError: cordova is not defined

this my index.html
image

this my app.js

and this my controller. im create a some function.
image

how to fix it?
thx A_Burgess :slightly_smiling: I’m very appreciative for the reply :slightly_smiling:

Maybe you can use a full js solution like cryptojs.

At the top of file try inserting the code:

declare var cordova;

you must to wait the event “deviceready” before cordova variable be defined
add event listener and push your code there

 document.addEventListener("deviceready", onDeviceReady, false);
     function onDeviceReady() {
           //.....then you can use cordova here 
     }