Skip to content

Cordova File Encryption Plugin for Android and iOS

License

Notifications You must be signed in to change notification settings

prsuhas-zz/cordova-plugin-file-encryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Cordova File Encryption Plugin for Android and iOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published