npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

korean-nodejs-obfuscator

v1.0.1

Published

Custom Babel AST-based high-resilience JavaScript obfuscator for Node.js

Downloads

318

Readme

korean-nodejs-obfuscator 🛡️

상용/서드파티 라이브러리(javascript-obfuscator 등)에 일절 의존하지 않고, @babel AST 파이프라인으로 직접 제작한 독자적 고강도 자바스크립트 난독화 엔진입니다.
한글/유니코드(UTF-8) 완전 보존, async/await 비동기 문맥 안정성 보장, 웹 기반 범용 디옵퓨스케이터(webcrack, synchrony 등)의 패턴 매칭을 무력화하도록 설계되었습니다.


🌟 주요 특징 (Core Features)

  1. 동적 솔트 기반 문자열 가상화 (Dynamic Key String Virtualization)
    • 백틱 템플릿(TemplateLiteral) 및 모든 평문 문자열을 분해하여 인덱스/솔트 기반 XOR 연산 후 Base64 풀에 적재.
    • require() 및 모듈 경로 등 필수 런타임 식별자를 제외한 모든 문자열을 런타임 디코더 호출식으로 은닉.
  2. 한글 및 유니코드 100% 보존 (UTF-8 Compliant)
    • 런타임 디코더에 TextDecoder / Node.js Buffer 기반 UTF-8 바이트 시퀀스 조립 방식을 적용하여 한글 깨짐 없이 원본 완벽 복원.
  3. 객체 속성 접근자 전면 은닉 (Computed Member Expression)
    • req.headers, req.socket.remoteAddress, res.json 등 모든 멤버 접근자를 계산된 속성(obj[_0xλ(idx, salt)])으로 치환.
  4. 제어 흐름 평탄화 (Control Flow Flattening, CFF)
    • 함수 블록을 switch-case 상태 머신 구조로 조각내고, 무작위 셔플된 시퀀스("3|0|2|1".split('|')) 순서로 점프 실행.
    • async/await 문맥에서도 Promise pending 없이 비동기 작업이 순차적으로 완벽히 resolve되도록 최적화.
  5. 불투명 술어 및 데드 코드 주입 (Opaque Predicates & Dead Code)
    • 항상 true로 귀결되는 정수 항등식을 주요 분기에 배치하고, else 분기에 무의미한 더미 연산을 채워 정적 분석 교란.
  6. 식별자 및 숫자 리터럴 맹글링 (Mangling)
    • 변수, 함수명을 난수 16진수(_0x...)로 난독화하고, 숫자를 2~3단계의 무작위 비트 연산식으로 치환.

📦 설치 (Installation)

# 글로벌 CLI로 설치
npm install -g korean-nodejs-obfuscator

# 또는 프로젝트 로컬 의존성 설치
npm install korean-nodejs-obfuscator

💻 사용법 (Usage)

1. CLI (커맨드라인 도구)

npx를 사용해 별도 설치 없이 즉시 실행할 수 있습니다.

# 기본 사용 (obfuscated_<원본파일명>.js로 자동 저장)
npx korean-nodejs-obfuscator input.js

# 출력 파일 경로 지정 (-o 또는 --output)
npx korean-nodejs-obfuscator server.js -o dist/bundle.min.js

2. Node.js API (프로그래밍 방식)

프로젝트 코드 내에서 모듈 형태로 임포트하여 사용할 수 있습니다.

const { obfuscate, obfuscateFile } = require('korean-nodejs-obfuscator');

// 1. 소스 코드 문자열 직접 난독화
const sourceCode = `
async function greeting(name) {
  const msg = \`안녕하세요, \${name}님!\`;
  console.log(msg);
  return msg;
}
greeting("홍길동");
`;

const obfuscatedCode = obfuscate(sourceCode);
console.log(obfuscatedCode);

// 2. 파일 경로를 지정하여 난독화
const result = obfuscateFile('./src/app.js');
console.log(result);

3. 웹 대시보드 GUI (Web Service)

드래그 앤 드롭 파일 업로드와 즉시 다운로드를 지원하는 내장 웹 서비스를 구동할 수 있습니다.

# 서버 구동 (기본 포트: 3000, .env에서 변경 가능)
npm start

브라우저에서 http://localhost:3000에 접속하여 .js 파일을 업로드하면 난독화된 파일이 자동으로 다운로드됩니다.


📂 프로젝트 구조

korean-nodejs-obfuscator/
├── bin/
│   └── cli.js            # CLI 실행 엔트리포인트 (npx korean-nodejs-obfuscator)
├── core/
│   └── obfuscator.js     # @babel AST 기반 커스텀 난독화 엔진 코어
├── public/
│   └── index.html        # 웹 GUI 파일 드롭존 인터페이스
├── index.js              # 패키지 메인 API (obfuscate, obfuscateFile)
├── server.js             # Express 기반 웹 GUI 서버
├── .env                  # 환경 변수 (PORT=3000)
├── .npmignore            # npm 배포 제외 목록 (웹 서버 및 개발 자산 제외)
└── package.json          # 패키지 명세

📄 라이선스 (License)

MIT License