Code/JavaScript

자바스크립트 소스 코드 난독화 유틸 비교

codens 2021. 2. 22. 18:46

 

javascript source code Obfuscate, 소스 코드 암호화

    - Obfuscation, obfuscator mangle, minimize, encode



//------------------------

* 속도 비교

원본 : 100%

terser : 96.4%

javascript-obfuscator : 103.6% (3%정도 느림)



//------------------------

* 크기 비교

원본 : 100%

terser : 37.7%

javascript-obfuscator : 50.5% (terser 보다 12.8%정도 더 큼)

//

원본 크기
(kb)

terser

javascript-obfuscator

1013

366

36.1%

479

47.3%

11.2%

508

251

49.4%

327

64.4%

15.0%

242

82.2

34.0%

111

45.9%

11.9%

121

39.1

32.3%

52.3

43.2%

10.9%

117

43.1

36.8%

60.6

51.8%

15.0%

 

 

 

 

 

terser
와 차이

terser 옵션 :  -c -m
javascript-obfuscator 옵션  --identifier-names-generator mangled-shuffled --identifiers-prefix ZZ


 

//---------------------------

* javascript-obfuscator  <===

https://github.com/javascript-obfuscator/javascript-obfuscator - 5.9k

    - v2.10.3 , 2021/01

    - 난독화 수준 높음, 

    - terser보다 크기는 12% 크고, 속도는 7% 느림

 

https://obfuscator.io/



- 설치

npm i -g javascript-obfuscator

 

환경변수 PATH에 다음 경로 추가 C:\Users\useID\AppData\Roaming\npm

 

- 실행

    - 원본 파일 1,013k , terser - 366kb

javascript-obfuscator in.js --output out.js  --identifiers-prefix B - 760k

 

javascript-obfuscator in.js --output out.js  --identifiers-prefix B --identifier-names-generator mangled-shuffled  - 480k




//---------------------------

*  terser / terser

https://github.com/terser/terser - 5.7k

    - v5.5.1 , 2020/11

    - 난독화 수준 낮음, 함수 안의 변수 이름 줄이는 수준

 

- 설치

npm i -g terser

 

- 실행

terser in.js -c -m -o out.js




//-----------------------------

* mishoo / UglifyJS

https://github.com/mishoo/UglifyJS - 11.3k

    - v3.12.8 , 2021/02

    - ES6지원 안함, 실행속도 느림, 난독화 수준 낮음,

 

-설치

npm i -g uglify-js

 

환경변수 PATH에 다음 경로 추가 C:\Users\useID\AppData\Roaming\npm

 

- 실행

uglifyjs in.js -c -m -o out.js




//----------------------------------

* google / closure-compiler

https://github.com/google/closure-compiler - 5.8k

    - v20210202 , 2021/02

    - 난독화 수준 낮음

 

https://developers.google.com/closure/compiler/

 

- 설치

npm i -g google-closure-compiler

 

- 실행

google-closure-compiler --js in.js --js_output_file out.js  --warning_level QUIET --compilation_level SIMPLE

    --compilation_level ADVANCED 옵션은 압축률이 높지만 컴파일시 에러가 자주 발생



    //-----------------------------------

    - 자바 버전 사용법 java maven

https://developers.google.com/closure/compiler/docs/gettingstarted_app

 

- 설치

*.jar 파일 다운로드

https://mvnrepository.com/artifact/com.google.javascript/closure-compiler



- 실행

java -jar closure-compiler.jar --js in.js --js_output_file out.js



//---------------------------

* YUI Compressor

https://github.com/yui/yuicompressor - 2.9k

    - v2.4.8 , 2013



* douglascrockford / JSMin

https://github.com/douglascrockford/JSMin - 625

    - 2017



//------------------------------------------

- 유료

https://jscrambler.com/



https://www.javascriptobfuscator.com/Default.aspx



Javascript Obfuscato

http://javascript-source.com/

 

http://stunnix.com/prod/jo/




//------------------------------------------------------------------------------

자바스크립트 소스 코드 난독화 해독(복원, 복호화)

javascript source Obfuscate decode

De-obfuscate



* JS Beautifier

https://beautifier.io/

    - http://jsbeautifier.org/

    - 설치 가능

beautify-web /js-beautify

https://github.com/beautify-web/js-beautify - 7.2k




//----------------------------

*  mindedsecurity / JStillery

https://github.com/mindedsecurity/jstillery/ - 682

https://mindedsecurity.github.io/jstillery/




//---------------

//pass

http://www.jsnice.org

 

https://www.thaoh.net/prettyjs/



http://deobfuscatejavascript.com/

    - 소스 http://deobfuscatejavascript.com/deobfuscate.js





반응형