2

I am evaluating to migrate to Ruby (Ruby on Rails) from PHP. One big concern I have is about the project encryption.

Currently in PHP I encrypt the projects before giving it to the clients by using Source Guardian.

However for Ruby the only option I found is rubyencoder.com (the same company as PHP source Guardian). has anyone tried this software and have first hand experience?

Is there any other software?

Is there any native way in Ruby to encrypt the project?

Jonathan Eustace
  • 2,469
  • 12
  • 31
  • 54
AK4668
  • 1,844
  • 4
  • 16
  • 18

2 Answers2

2

You should know that this is not really protecting your code. At some point, the code will have to be executed by Ruby's VM (let's assume you're on 1.9.x). The VM itself, unless modified, will only be able to understand the instructions in their unencrypted form.

What this means is that before the encrypted code can be executed, it will have to be transformed back into its original form. And someone badly craving to read your source code could do so by debugging the Ruby process and waiting for that decryption to happen.

Even if it's just the byte code instructions that you will get from this, it's possible to reconstruct quite readable source code from byte code interpretation, here is an example for Java, but similar things are possible for Ruby, too.

Code obfuscation might be more what you are looking for, but it is also a very risky option for Ruby code: it might break sophisticated meta programming features.

I've never been a friend of DRM measures, so it might be that I am quite opinionated here... but are you really, really convinced you will need such features?

emboss
  • 38,880
  • 7
  • 101
  • 108
1

There is a simple way of dealing with that if you can use Rubinius to execute the code (there might also exist a similar solution for JRuby since it runs on the JVM): With Rubinius you compile your source code to byte code and ship only the binary code to the client. That code can than be executed on the target system without giving away any source code. For detailed instructions and caveats see this blog post on the rubinius homepage: http://rubini.us/2011/03/17/running-ruby-with-no-ruby/

three
  • 8,262
  • 3
  • 35
  • 39