introducing JavascriptObfscate

This commit is contained in:
G047 2016-12-05 17:37:16 +00:00 committed by GitHub
parent e4d30861d5
commit 591e4f0015

View file

@ -0,0 +1,37 @@
/* globals UAS_parser */
/**
* Javascript Obfscate operations.
*
* @author G047 [drgoatyt@gmail.com]
* @copyright Crown Copyright 2016
* @license MIT
*
* @namespace
*/
var JavascriptObfscate = {
obfuscator : require('javascript-obfuscator'), //Needs to be installed with the package.json
/**
* Obfscate javascript operation.
*
* @param {string} source
* @returns {string}
*/
obfscate : function (source) {
var obfuscationResult = this.obfuscate(source, {
compact: true,
debugProtection: true,
debugProtectionInterval: true,
selfDefending: true,
});
source = obfuscationResult.getObfuscatedCode();
return source;
}
};
module.exports = JavascriptObfscate;