简体   繁体   中英

how to encrypt the local form data on the device using ionic cordova app

I have a cordova app which stores the offline forms on the device and once sync is done and app becomes online, all the data is send to the server.It is supporting both ios and android devices and in near future it will also support windows.I have googled it and found some plugins for the encryption like crypt-file.But could not find the proper documentation on how to use these and which one serves the purpose best. Any suggestion is highly appreciated. Thanks.

The things are still not clear to me but if you want to use cordova-plugin-crypt-file then refer the below steps:

Step 1.Install cordova plugin using "cordova plugin install cordova-plugin-crypt-file".

Step 2.Change in plugin hook script places under "..\\plugins\\cordova-plugin-crypt-file\\plugin.xml" for including and excluding files to encrypt.

<cryptfiles>
    <include>
        <file regex="\.(htm|html|js|css)$" />
    </include>
    <exclude>
    </exclude>
</cryptfiles>

Step 3.Run "cordova build"command to start build process. All the source files (HTML, CSS and JS) will be encrypted and bundled in ".apk" file.

At the runtime, requested source file will be decrypted by decryption logic written in java file placed under "..\\src\\com\\tkyaji\\cordova\\DecryptResource.java".

For DB label encryption use SQLCipher DB that is an SQLite extension that provide transparent 256-bit AES encryption for DB files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM