From: Charles O Nutter Date: 2006-09-29T08:51:29+09:00 Subject: Re: Obfuscation (was Re: Ruby with Qt or GTK ?) On 9/28/06, Ken Bloom wrote: > Ruby can't even be really effectively obfuscated (at least not as > effectively as Java), because it depends on things being named the same > for duck typing to work. In Java, you can rename any method in the > inheritance chain that isn't defined in the parent class, you also get > overloading to help with the obfuscation so you start by renaming > functions to as many overloads of "a" as possible, then to as many > overloads of "b" as possible and so forth. In Ruby, you don't have the > naming heuristic, nor do you have the ability to create many overloads of > the same function. Java includes all naming in the compiled bytecodes as well, because it's an integral part of the method signatures. Java code can be decompiled to almost exactly what was fed in, with few exceptions. Under JRuby, Ruby code will probably be obfuscated even more than Java code. I've been working on the compiler for JRuby, and I guarantee the resulting bytecode won't be easily reversible. You might be able to reverse it to some pretty heinous Java code, but reversing back to the original Ruby source will be practically impossible. Even if the method names are still present, everything else will be Java bytecodes, many of them specific manipulations of JRuby's runtime. Ruby's AST itself can be reversed, but not perfectly, and if passed through a compiler like the one in JRuby, it will be mostly unrecognizable. -- Contribute to RubySpec! @ www.headius.com/rubyspec Charles Oliver Nutter @ headius.blogspot.com Ruby User @ ruby.mn