From: Jean-Hugues ROBERT Date: 2002-04-17T07:26:51+09:00 Subject: Re: crypting ruby source Hello, If all you need is making the source code inconvenient to read by casual users, I guess one direction to explore would be to change every LF into ; or change every whitespace into \ or a combination of both. You may also want to generate empty indentations or random one. Overall this would make the source rather unreadable for a human, but yet OK for the Ruby interpreter. This may break the line number info in exceptions, but maybe there is a way to map "obscure" line numbers back to "readable" line numbers. BTW: making a "single liner" out of a normally presented source code may have an interesting result regarding how often set_trace_proc() gets called with "Line" to notify that execution is progressing to a new line. This may bring some small benefit in term of speed... Of course a Ruby Pretty Printer may restore the source code to some very readable form. But I don't know if such a beast exists and I guess the users that you are addressing may not make the effort to build/find one, or else they may as well crack a better crypting scheme. All of this reminds me the "obfuscation" feature of some Java compiler that "helps" make the code more difficult to decompile. I still have to understand people that consider source code valuable, considering the fact that very often it is already difficult enough to understand by those who initially wrote it, not to mention that code evolves and by the time a competitor "decrypt" your version X, you will release a better version Y, and stay ahead. Jean-Hugues