"매 reverse-engineering cost 의 raise — semantic 보존하면서 readability 파괴". Crypto 처럼 secrecy 가 아닌 cost-shifting — determined attacker 는 매 결국 풀 수 있음. 매 modern usage: anti-piracy, anti-cheating, license validation, 매 LLM-based deobfuscation 의 등장으로 의미 retreat.
매 핵심
매 layer
Lexical: rename identifier (x_a1b2c3).
Control flow: opaque predicate, control-flow flattening.
Data: string encryption, constant unfolding.
Anti-analysis: anti-debug, VM detection, integrity check.
Virtualization: custom VM bytecode (VMProtect, Themida).
매 trade-off
Performance: 2-10× slowdown (virtualization 시).
Size: 2-5× binary bloat.
Stability: false positive 가능 (anti-debug).
Security: 매 cost-raise 만 — break 시간을 hours → weeks 로.
매 응용
JavaScript bundle (anti-scraping).
Mobile app DRM, license check.
Game anti-cheat (e.g., VAC, EAC).
Malware (defensive obfuscation).
💻 패턴
String encryption
// Before
constKEY="secret-api-key";// After
const_0xa1b2=['c2VjcmV0','LWFwaQ==','LWtleQ=='];const_0xc3d4=(i)=>atob(_0xa1b2[i]);constKEY=_0xc3d4(0)+_0xc3d4(1)+_0xc3d4(2);
Control-flow flattening
// Before: linear flow
voidf(){a();b();c();}// After: dispatcher loop
voidf_obf(){intstate=0;while(state!=-1){switch(state){case0:a();state=7;break;case7:b();state=3;break;case3:c();state=-1;break;}}}
Opaque predicate
// Always true at runtime, hard to determine statically
autoopaque=[](intx){return(x*x*x-x)%3==0;};// always true for any int
if(opaque(rand()))real_logic();elsefake_branch();// dead but appears live to disassembler
setInterval(()=>{constt=performance.now();debugger;// pauses if devtools open
if(performance.now()-t>100){// devtools detected
location.href='about:blank';}},1000);