Giter Site home page Giter Site logo

gulp-protect's Introduction

gulp-protect

Protect applications by encrypting sourcecode with AES cipher using aes-js

Features

  • Encrypt application code with 128, 192 or 256 bits key
  • Adds decryption method
  • Adds aes-js
  • Adds authentication method
  • Adds callback method

Installation

$ npm install gulp-protect --save

Description

This module encrypts your main application code with AES CTR.

// Your application
function myApp () {
  alert('decrypted');
}

// Encrypted 
[212,216,224,87,158,154,86,11,121,4,163,89,221,203,131,167,179,129,11,230,3,103,135,49,78,140,231,215,166,136,158,80,240,246,218,213,132,147,100,40,163,220,15]

The encrypted cipher will be saved in a javascript file with an authentication method for retreiving a decryptionKey from an API, and a decryption method which will evaluate the decrypted code. After decryption a custom callback method will be called to bootstrap your application.

Usage

The example uses the module to protect an AngularJS application.

var gulp = require("gulp");
var protect = require("gulp-protect");

// Provide 16, 24 or 32 bytes encryption key
var encryptionKey = "Secret16BytesKey";

// Set options
var options = { 
  partials: {
    auth: 'path/to/function.js',
  },
  options: {        
    url: 'http://your.authentication.api'
  }
}

// String with callback method 
var callback = 'function () { angular.bootstrap(document, [\'yourApp\']); }')

// Task
gulp.task('protect', function() {
  return gulp.src('dist/app.js')
    .pipe(protect(encryptionKey, options, callback))
    .pipe(gulp.dest('dist'));
});

Now you can run the task from the commandline

$ gulp protect

gulp-protect's People

Contributors

sjeedandi avatar

Watchers

James Cloos avatar Quynh Le avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.