views:

171

answers:

5

Are there any applications out there that will let me encode my Ruby on Rails code so others can't read it? I plan on selling a few small applications, but I really don't want everyone knowing my code.

Thanks.

A: 

No, there is no way to have executable code that can't be read. Hard to read yes, impossible to read is... impossible. Best you can do is obfuscate, of which there are many examples around the net (but I don't know of any libraries that do it for you).

Chuck Vose
+2  A: 

Only example I have seen in the wild is Mingle from ThoughtWorks, which runs on JRuby, which I think they must have modified in some way to run the encrypted code.

http://www.thoughtworks-studios.com/mingle-agile-project-management

I think they may have used something like this AOT compiler: http://kenai.com/projects/jruby/pages/RailsAOT

This also looks promising: http://www.infoq.com/news/2008/10/rubyencoder

Check out this answer for other ideas. http://stackoverflow.com/questions/99553/can-you-distribute-a-ruby-on-rails-application-without-source

Andrew Kuklewicz
A: 

If you want people to able to run your code (and if you don't, then why did you write it in the first place?), then their CPU needs to be able to execute your code. In order to be able to execute the code, the CPU needs to be able to understand it.

Since CPUs are dumb, and humans aren't, this means that humans can understand the code as well.

The only way you can protect your code through technical means, is if you "own" the entire execution path: you need to build your own CPU, your own computer, write your own operating system and your own Ruby interpreter. Then, and only then can you protect your code. (But note that even the tiniest mistake will render all of your protections useless. Microsoft, Apple, Sony, the Music Industry and the Movie Industry can attest to that.)

Or, you could just do nothing, which means that your code will be automatically protected by copyright law.

Jörg W Mittag
A: 

Thanks for all your answers! Currently I'm looking at jRuby and Ruby Encoder options but if I find neither are what I want then I think I should just sell the code and focus more on getting customers. It really doesn't make sense to spend all this time and money on an encryption that can be easily cracked anyways.

Matt
The whole thing makes no sense, RoR makes web apps ... Host a web app ... Profit ...
railsninja
+1  A: 

Maybe you could host the application yourself.

This way nobody will have ever access to your code and you're clients will use the application everywhere via Internet and also will pay you for the support.

In order to host rails application the easiest way you could try http://heroku.com/ or even set a small VPS with apache and mod_passenger.

fjuan
Ive been thinking more and more today about hosting it myself. The only downside is the monthly hosting cost, but I could get the smallest server and see if people even like the the apps then expand. Thanks a lot for the input[:
Matt
If monthly hosting cost is an issue then I suspect that the idea for the app isn't much of a winner. RoR is a web framework, it makes perfect sense to host it yourself and charge a subscription fee to these services. It's a proven business model and if your app is good and people want to use it then it's so the way to go.
railsninja