LWN.net Logo

Protect Your Source Code: Obfuscation 101 (O'ReillyNet)

Protect Your Source Code: Obfuscation 101 (O'ReillyNet)

Posted Apr 9, 2005 21:30 UTC (Sat) by farnz (guest, #17727)
Parent article: Protect Your Source Code: Obfuscation 101 (O'ReillyNet)

The crazy thing about it? The best way to actually obfuscate something like Java or C is to simply ensure that the compiler does as much optimisation as possible, and that where names "leak" from the source into the object code, they get renamed to something less useful.

For example, in Java variable names can be obtained from the .class files; a simple program can rename your variables "if", "for", "a", "b" etc., thus not only obfuscating the code, but making a decompiled version not compilable.

In C, it's even better; a good optimising compiler can do things like block reordering, thus rendering the compiler output unreadable.


(Log in to post comments)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds