🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

client-encrypt-file-upload

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

client-encrypt-file-upload

Accepts a file upload Blob, base64 encodes it, encrypts it and returns encrypted data via callback E.G {type: 'encrypted-string', data: 'iihkwqhury8473y4r3y3443yr3'}

latest
npmnpm
Version
1.0.1
Version published
Weekly downloads
10
66.67%
Maintainers
1
Weekly downloads
 
Created
Source

client-encrypt-file-upload

A client side file encryptor for Node.js.

Installation

Add it to your node.js project via:

npm install client-encrypt-file-upload --save

Usage

As this is a client side script you'll need to compile this module and it's dependencies using browserify or something similar

browserify node_modules/client-encrypt-file-upload/dist/index.js  -o bundle.js

To encrypt a file upload:

    //Add change event to file upload field
    document.addEventListener('DOMContentLoaded',function() {
        document.querySelector('input[name="input_4"]').onchange=changeEventHandler;
    },false);

    //Handle the change event and call encryptFile
    //Encrypt file blob with secret key bla-bla-bla-bla-bla and return encrypted response data
    //via callback E.G {type: 'encrypted-string', data: 'iihkwqhury8473y4r3y3443yr3'} 
    function changeEventHandler(event) {
        encryptFile(event.target.files[0], 'bla-bla-bla-bla-bla', function(response){
          console.log(response.type);
          console.log(response.data);
        });
    }

FAQs

Package last updated on 26 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts