N00b Q: Obfuscation and locking the source

I have been doing some Ruby on and off this year, so I am still a n00b.
My question is:

I create a ruby file, and now I want the source protected and
unreadable, how do I go about obfuscating my ruby file so that I can
distribute it as a non-open-source application?

I suppose, depending on your platform, script2exe might do the trick for
you. Question though: why are you trying to hide your source?

James H

You could use ZenObfuscator, by Ryan D, www.zenspider.com (its
someewhere on
that site)
Or you could just obfuscate the pure ruby, by hand, althought someone
can
still deobfuscate it.

j`ey
http://www.eachmapinject.com

Danno wrote:

I have been doing some Ruby on and off this year, so I am still a n00b.
My question is:

I create a ruby file, and now I want the source protected and
unreadable, how do I go about obfuscating my ruby file so that I can
distribute it as a non-open-source application?

This was discussed on this mailing list not too long ago (and on
numerous other occasions in the past). A search of the list archives
should turn up various ideas and techniques to get you started.


James B.

“I was born not knowing and have had only a little
time to change that here and there.”

  • Richard P. Feynman

James B. wrote:

numerous other occasions in the past). A search of the list archives
should turn up various ideas and techniques to get you started.

I did, all I found were jokes about how ruby is already obfuscated, and
many different ways of saying ‘no’, and that was back in 2004. I don’t
know if that’s the answer I want to leave with. Care to be a little
more helpful and point me in the right direction?

On Jul 17, 2006, at 10:10 AM, Danno wrote:

more helpful and point me in the right direction?
We did a Ruby Q. a while back that might offer ideas:

http://www.rubyquiz.com/quiz34.html

It’s important to remember how easily the determined person will get
past this though.

James Edward G. II

James Edward G. II wrote:

unreadable, how do I go about obfuscating my ruby file so that I can
many different ways of saying ‘no’, and that was back in 2004. I don’t
know if that’s the answer I want to leave with. Care to be a little
more helpful and point me in the right direction?

We did a Ruby Q. a while back that might offer ideas:

http://www.rubyquiz.com/quiz34.html

It’s important to remember how easily the determined person will get
past this though.

I’ll agree with that. Thanks.

From: “Danno” [email protected]

This was discussed on this mailing list not too long ago (and on
numerous other occasions in the past). A search of the list archives
should turn up various ideas and techniques to get you started.

I did, all I found were jokes about how ruby is already obfuscated, and
many different ways of saying ‘no’, and that was back in 2004. I don’t
know if that’s the answer I want to leave with. Care to be a little
more helpful and point me in the right direction?

Had you seen the ZenObfuscate post?
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/196955

It’s a commercial offering and does have a Known Limitations
paragraph that’s worth noting.

I’m still trying to sort out how to ship my own commercial
ruby software. Frankly, if it were possible to ship a game
open source and get paid for it, that would be my preferred
route.

My plan is to do the next best thing, and use the release
model pioneered by id Software. Initially, parts of the
game are open source, and the core engine is closed source.
Eventually, the entire game is open sourced (usually
coinciding with the release of the next game in the series.)

So that puts me back in square 1. How to close parts of
my ruby source, even if for a limited time.

I’m considering ZenObfuscate, but the limitations listed
seemed more severe than I would have hoped.

I may go with some embedded decryption key solution and
hope for the best… :-}

(Or, since my application is a mix of C and ruby, just
leave the ruby parts open from the beginning.)

Sorry I can’t offer much in the way of concrete solutions.
But I’m going to have to come up with something eventually,
myself…

Regards,

Bill

On Mon, 17 Jul 2006 20:45:55 +0200, Bill K. [email protected] wrote:

Had you seen the ZenObfuscate post?
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/196955

It’s a commercial offering and does have a Known Limitations
paragraph that’s worth noting.

Have you seen Ruby2CExtension (http://ruby2cext.rubyforge.org/) ?

Obfuscation isn’t its main goal but it can be used to obfuscate Ruby
code
just fine. And (judging from the ZenObfuscate announcement) it has less
limitations than ZenObfuscate, it can for example translate itself to a
C
extension.

I hope that helps,
Dominik

Danno wrote:

This was discussed on this mailing list not too long ago (and on
numerous other occasions in the past). A search of the list archives
should turn up various ideas and techniques to get you started.

I did, all I found were jokes about how ruby is already obfuscated, and
many different ways of saying ‘no’, and that was back in 2004.

Weird; seems the word “obfuscate” didn’t really figure into the
discussions about obfuscating source code. My apologies.

Searching on “hiding” or “protecting” source code was a little better.

This may be useful: http://www.ruby-forum.com/topic/69161#90229

Generally someone asks how they can compile Ruby code into some binary
form to hide the source, and the answer is, you really can’t, not in any
secure manner.

Wish I had better links.

My search-fu has failed me. :frowning:


James B.

http://web2.0validator.com - We’re the Dot in Web 2.0
http://refreshingcities.org - Design, technology, usability
http://yourelevatorpitch.com - Finding Business Focus
http://www.jamesbritt.com - Playing with Better Toys

James B. wrote:

distribute it as a non-open-source application?

http://refreshingcities.org - Design, technology, usability
http://yourelevatorpitch.com - Finding Business Focus
http://www.jamesbritt.com - Playing with Better Toys

Here’s the link to a thread I started on this topic a couple of years
ago. As I recall, it was a very good treatment of the possibilities.
Enjoy!

http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/aa4d1a0a1c596763/41e20c85ddbc0579?q=obfuscation+kenosis&rnum=1#41e20c85ddbc0579

From: “Dominik B.” [email protected]

Have you seen Ruby2CExtension (http://ruby2cext.rubyforge.org/) ?

Obfuscation isn’t its main goal but it can be used to obfuscate Ruby code
just fine.

Nice !!!

Wow, very cool.

Thanks,

Bill

On Jul 17, 2006, at 1:03 PM, Dominik B. wrote:

Obfuscation isn’t its main goal but it can be used to obfuscate
Ruby code just fine. And (judging from the ZenObfuscate
announcement) it has less limitations than ZenObfuscate, it can for
example translate itself to a C extension.

So can ZenObfuscate.

On 7/17/06, Bill K. [email protected] wrote:

I’m still trying to sort out how to ship my own commercial
ruby software. Frankly, if it were possible to ship a game
open source and get paid for it, that would be my preferred
route.

Have you already taken a look at the Street Performer Protocol[1]?
It’s a way to do exactly that, and it’s not restricted to games.

That article is a bit old, but AFAIK there have been some succesful
implementations. Fundable.org[2] is a site that allows you to release
something under this model.

[1]http://www.firstmonday.dk/issues/issue4_6/kelsey/
[2]http://www.fundable.org/