mirror of
https://github.com/gchq/CyberChef.git
synced 2025-07-04 11:52:24 -04:00
introducing JavascriptObfscate
This commit is contained in:
parent
e4d30861d5
commit
591e4f0015
1 changed files with 37 additions and 0 deletions
37
src/js/operations/JavascriptObfscate.js
Normal file
37
src/js/operations/JavascriptObfscate.js
Normal 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;
|
Loading…
Add table
Add a link
Reference in a new issue