Matt
Matt

Reputation: 33

Encoding Ruby on Rails code?

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.

Upvotes: 2

Views: 1938

Answers (5)

fjuan
fjuan

Reputation: 2324

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.

Upvotes: 0

Matt
Matt

Reputation: 33

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.

Upvotes: 1

Jörg W Mittag
Jörg W Mittag

Reputation: 369458

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.

Upvotes: 2

Andrew Kuklewicz
Andrew Kuklewicz

Reputation: 10701

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. Can you Distribute a Ruby on Rails Application without Source?

Upvotes: 4

Chuck Vose
Chuck Vose

Reputation: 4580

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).

Upvotes: 0

Related Questions