Skip to content
File encryption for Cordova.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
src Use cordova method for finding uri Aug 10, 2015
tests Add CodeClimate jshint rule Aug 10, 2015
www
.editorconfig
.eslintrc
.gitignore Properly install conceal aar Jul 27, 2015
.travis.yml
LICENSE Change to MIT Mar 15, 2015
README.md Update name in README Jun 12, 2015
gulpfile.js Migrate to eslint Jul 27, 2015
package.json
plugin.xml Bump patch Aug 10, 2015

README.md

cordova-safe

Build Status Code Climate

Simple file encryption for Cordova.

Install

$ cordova plugin add cordova-safe

Usage

var safe = cordova.plugins.disusered.safe,
    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');
}

safe.encrypt('file:/storage/sdcard/DCIM/Camera/1404177327783.jpg', key, success, error);

API

The plugin exposes the following methods:

cordova.plugins.disusered.safe.encrypt(file, key, success, error);
cordova.plugins.disusered.safe.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

License

MIT © Carlos Rosquillas

You can’t perform that action at this time.