Storing data in the iOS Keychain
When it comes to storing data securely, the best method is to use something made for secure storage. In iOS, this is the Keychain. In Android, there is a Keychain of sorts, but it's not a general data store as is the iOS Keychain. As such, this section is for iOS only. For Android, the best place to store secure data is in the application's data directory on internal storage. It's not a complete protection, but neither is the iOS Keychain. (Should the device be rooted, all bets are off as the data is easily accessible. This applies to both iOS and Android.)
For more information regarding the Keychain itself, see: https://developer.apple.com/library/mac/documentation/Security/Conceptual/keychainServConcepts/02concepts/concepts.html.
First, you need to install the plugin:
cordova plugin add com.shazron.cordova.plugin.keychainutil
Next, you might want to read up on the entire documentation available at: http://plugins.cordova.io/#/package/com.shazron.cordova.plugin...