From: Charles Oliver Nutter Date: 2007-09-03T00:36:06+09:00 Subject: Re: Seeing the source John Joyce wrote: > > On Sep 1, 2007, at 5:41 AM, Phil wrote: > >>> Hello. I'm new to Ruby (and also to scripting languages). >>> >>> I'd like to know if, since Ruby is a scripting language, there's a way >>> to hide the code when deploying an application. I'd users to be unable >>> to see the source. >>> >>> Is there a solution for that? >> >> http://www.rubyinside.com/px-a-quick-and-silly-ruby-obfuscation-system-7.html >> >> >> If you want to obfuscate code for business reasons, though, you might >> want to use a different language (Perl is naturally obfuscated :P), >> where obfuscators are available on a larger scale (Java and .NET >> languages should offer that, with them being enterprise-y and all). >> >> The question is: Why do you need that? If you license your software, >> you could include a section on using the source in other applications >> a big, big no-no (well, you'd reiterate copyright laws, basically), >> and that your code is a trade secret. IANAL, though, nor do I play one >> on TV, so take that with a grain of salt. >> >> -- >> Phillip Gawlowski >> >> > If you really think you need to obfuscate your code, then you're doing > something wrong. It is always possible to decompile stuff even with > compiled languages. PHP users often use obfuscation to try and hide stuff. > Consider crafty use of file permissions settings, and simply burying > things in modules with hard to read names. Disassemble, sure. But it's fairly easy to generate sequences of assembly instructions or bytecodes that can't be decompiled into any reasonable language. JRuby's compiler, for example, emits bytecode that could never be reversed into .java files, largely because it uses the operand stack much more heavily and forgoes the use of local variables. - Charlie