cordova-plugin-file-encryption

1.0.6 • Public • Published

cordova-plugin-file-encryption

Cordova File Encryption Plugin for Android and iOS.

Install

$ cordova plugin add cordova-plugin-file-encryption

Usage

var encryptor = cordova.plugins.fileEncryption,
    key = 'someKey';
 
 
function success(encryptedFile) {
  console.log('Encrypted file: ' + encryptedFile);
 
  safe.decrypt(encryptedFile, key, function(decryptedFile) {
    console.log('Decrypted file: ' + decryptedFile);
  }, error);
}
 
function error() {
  console.log('Error with cryptographic operation');
}
 
encryptor.encrypt('file:/storage/sdcard/DCIM/Camera/1404177327783.jpg', key, success, error);

API

The plugin exposes the following methods:

cordova.plugins.fileEncryption.encrypt(file, key, success, error);
cordova.plugins.fileEncryption.decrypt(file, key, success, error);

Parameters:

  • file: A string representing a local URI
  • key: A key for the crypto operations
  • success: Optional success callback
  • error: Optional error callback

Package Sidebar

Install

npm i cordova-plugin-file-encryption

Weekly Downloads

2

Version

1.0.6

License

MIT

Unpacked Size

69.7 kB

Total Files

19

Last publish

Collaborators

  • suhaspr