开发者

Protect Ruby code

开发者 https://www.devze.com 2023-02-18 21:23 出处:网络
I\'m writing Ruby app and I want to use some top-secret algorithms. So how would be the best to protect them from unauthorized access.

I'm writing Ruby app and I want to use some top-secret algorithms. So how would be the best to protect them from unauthorized access.

I have 2 ideas:

  • write them in C and load using FFI (I wonder if It's possible this way)
  • Marshal ruby code, encode it and then store开发者_开发百科 in file

Maybe someone know better idea or can show me that these ideas are stupid or wrong. Thanks in advice.


You cannot protect the algorithm you are writing by changing it to C .. May be you can encrypt the source files. Try truecrypt

Edit

After some googling i found these articles related to ruby code obfuscation

  1. protecting-your-ruby-source-code-for-end-user-applications/
  2. Ruby Encoder Protects Source Code for US Department of Defense Project
  3. http://rubyencoder.com/


You can try some code obfuscation techniques. For example RubyEncoder compiles Ruby source code into a encrypted bytecode format. And here is another thread related to your question Ruby obfuscator


If you are willing to craft your own solution instead of buying and already made one like RubyEncoder, as stated on other answer here, there is an article that try to describe a method to protect your source code, and you can also implement all sort of protection you think is feasible, as you are going to do all by hand:

http://mountcastle.posterous.com/protecting-your-ruby-source-code-for-end-user

0

精彩评论

暂无评论...
验证码 换一张
取 消