JavaScript Obfuscater?
by i3eaI - Thursday August 17, 2023 at 04:28 AM
#1
Does anyone have a secure JavaScript obfuscater that’s not obfuscater.io? I’m having trouble finding an obfuscater so my code does not get leaked, thanks for any help! Big Grin
Reply
#2
making your own simple one is the best option
Ban reason: Requested (Permanent)
Reply
#3
victim dateline='[url=tel:1692247316' Wrote: 1692247316[/url]']
making your own simple one is the best option

Any recommendations of what libraries to use? And in py right?
Reply
#4
you can use this tools with node js https://www.npmjs.com/package/@skiff-org/skiff-crypto
Reply
#5
I was using UglifyJS https://github.com/mishoo/UglifyJS
Reply
#6
goated obfuscator that as of now isn't getting picked up by AV: https://www.javascriptobfuscator.com/
Reply
#7
(09-04-2023, 02:21 PM)platypus_h4x3r Wrote: ... that as of now isn't getting picked up by AV ...

I think this is the dumbest thing I've read on the forum to date.
Reply
#8
(08-17-2023, 04:28 AM)i3eaI Wrote: Does anyone have a secure JavaScript obfuscater that’s not obfuscater.io? I’m having trouble finding an obfuscater so my code does not get leaked, thanks for any help! Big Grin

I agree with @victim build you own : 

- Using JavaScript Obfuscator with Node.js

To use javascript-obfuscator, you can install it via npm:

npm install --save javascript-obfuscator

Then, you can create a Node.js script to obfuscate your code:
const JavaScriptObfuscator = require('javascript-obfuscator'); const codeToObfuscate = `   function helloWorld() {     console.log('Hello, world!');   } `; const obfuscatedCode = JavaScriptObfuscator.obfuscate(   codeToObfuscate,   {     compact: true,     controlFlowFlattening: true,     controlFlowFlatteningThreshold: 1,     numbersToExpressions: true,     simplify: true,     shuffleStringArray: true,     splitStrings: true,     stringArrayThreshold: 1   } ).getObfuscatedCode(); console.log(obfuscatedCode);

- Using Terser with Node.js

To use terser, you can also install it via npm:

npm install terser

Then, you can create a Node.js script:

const Terser = require("terser"); const codeToMinify = `   function helloWorld() {     console.log('Hello, world!');   } `; const options = {   compress: {     dead_code: true,     conditionals: true,     booleans: true   },   mangle: {     toplevel: true   } }; const result = Terser.minify(codeToMinify, options); if (result.error) {   console.log("Terser Error: ", result.error); } else {   console.log(result.code); }
- Using Webpack Obfuscator

To use webpack-obfuscator, you first need to install the package:

npm install webpack-obfuscator

Then, add it to your Webpack configuration file (webpack.config.js):

const JavaScriptObfuscator = require('webpack-obfuscator'); module.exports = {   // ... other Webpack configurations   plugins: [     new JavaScriptObfuscator ({       rotateStringArray: true,       stringArray: true,       // other options     }, [])   ] };

These examples are quite basic, and the obfuscation options can be adjusted according to your needs.

you can also use python :

install terser : 

npm install -g terser

npm install terser

python code : 
import subprocess def obfuscate_js(input_file, output_file):     try:         subprocess.run(["terser", input_file, "-o", output_file, "-c", "-m"])         print(f"Obfuscation successful. Output file is {output_file}")     except Exception as e:         print(f"An error occurred: {e}") # Prompt the user for input and output file paths input_file = input("Please enter the path of the input JavaScript file: ") output_file = input("Please enter the path where you'd like to save the obfuscated file: ") # Use the function obfuscate_js(input_file, output_file)
Reply
#9
Just dont if you want to hide your code just make a api is the only good way to do it
Reply
#10
https://www.toptal.com/developers/javascript-minifier
Reply




 Users browsing this thread: