ANN: ZenObfuscate - for when you really really have to ship

“Being perfectly honest, your obfuscator has made me feel like
writing RubyCocoa apps is a commercially viable business, whereas
before I had my doubts.” - Aidan R.

  • ZenObfuscate
    • What is it?
      • For when you really really have to ship a binary.
      • Lets you: Write in ruby, and ship a binary.
      • ZenObfuscate is a translator for a fairly large subset of
        ruby that converts your pure ruby code into a dynamically
        loadable binary, protecting your intellectual property(*).
    • How does it work?
      zenobfuscate has a commandline interface that takes the
      specified ruby files and outputs a dynamically loadable
      binary (.bundle on osx, .so on unix/linux and .dll or
      windows).
      • TODO: diagram
      • e.g., ./bin/zenobfuscate -o mylibrary lib/blah.rb; ruby
        -rmylibrary -e ‘use_my_library’
      • Built on a solid foundation: RubyInline and ParseTree. Long
        standing open source packages for ruby.
    • When is it available?
      Available nowish on an individual basis
    • How much does it cost and what is its licensing?
      ZenObfuscate costs $2500 for a site license or is
      individually negotiable. ZenObfuscate is a commercial product
      produced wholly by Eric H. and Ryan D. and is not for
      redistribution. All rights are reserved, etc., etc. Binaries
      produced from ZenObfuscate have no restrictions of any kind
      (except determined by their authors).
    • Requirements
      ruby 1.8.x, ruby2c, parse_tree, rubyinline (all available as
      gems)
      available on darwin ppc, darwin intel, freebsd x86, freebsd
      amd/64bit, and linux x86 (with coaxing).
    • Known Limitations
      There are issues with what the obfuscator can translate to C
      and as a result you may need to modify your code in order to
      translate it. Usually this is a pretty straightforward and
      simple task. We do a good job of translating static ruby to
      its equivalent C, but not all ruby has an equivalent in C.
      • Only translates methods in classes and modules, not
        freestanding code.
      • Explicit returns are required in all methods.
      • Temporary: Conditional logic (including ?:slight_smile: may not be on the
        right hand side of an assignment.
      • Temporaryish: Exception handling and generic block closures
        currently don’t translate.
      • Some expressions in ruby we don’t currently do, but could
        upon request, where some other ruby expressions will never
        translate.

Will this work with a Rails app?

----- Original Message -----
From: “Ryan D.” [email protected]
To: “ruby-talk ML” [email protected]; [email protected]
Sent: Tuesday, June 13, 2006 3:56 AM
Subject: ANN: ZenObfuscate - for when you really really have to ship a
binary

On 6/13/06, Kris L. [email protected] wrote:

Will this work with a Rails app?

----- Original Message -----
From: “Ryan D.” [email protected]

 - Known Limitations

     - Explicit returns are required in all methods.
     - Temporary: Conditional logic (including ?:) may not be on the
       right hand side of an assignment.
     - Temporaryish: Exception handling and generic block closures
       currently don't translate.

Based on those limitations, I would think not.


Regards,
John W.

On 6/13/06, Kris L. [email protected] wrote:

"Being perfectly honest, your obfuscator has made me feel like
- How does it work?
Available nowish on an individual basis
- How much does it cost and what is its licensing?
ZenObfuscate costs $2500 for a site license or is

That price looks a little extreme for what I have in mind… are there
any alternative obfuscators? Alternatively could a
percentage-of-returns license fee be negotiated (Eric)?

Are programs written in Ruby distributable under any license you like?
A friend of mine has proposed selling a program I wrote in Ruby but
the thought of doing so made me feel like I was leveraging vast (GPL)
resources avaliable to me for free - and profiting off of them by
adding comparatively very little. I have in the past simply sold my
development time, which seemed a fairer trade since copying my
programs is a trivial task.

Does anyone here actually sell Ruby programs themselves as products?

Les

On 6/13/06, Kris L. [email protected] wrote:

Will this work with a Rails app?

----- Original Message -----
From: “Ryan D.” [email protected]

 - Known Limitations

     - Explicit returns are required in all methods.
     - Temporary: Conditional logic (including ?:) may not be on

the

       right hand side of an assignment.
     - Temporaryish: Exception handling and generic block closures
       currently don't translate.

Based on those limitations, I would think not.

I wonder if Rails apps will ever be compiled?

On Jun 13, 2006, at 6:20 AM, John W. wrote:

       right hand side of an assignment.
     - Temporaryish: Exception handling and generic block  

closures

       currently don't translate.

Based on those limitations, I would think not.

Actually we have every reason to believe that we can obfuscate rails
apps. Obviously you wouldn’t obfuscate the whole ruby stack, but
models and controllers should de doable.

On Jun 13, 2006, at 7:29 AM, Leslie V. wrote:

That price looks a little extreme for what I have in mind… are there
any alternative obfuscators? Alternatively could a
percentage-of-returns license fee be negotiated (Eric)?

see:

- How much does it cost and what is its licensing?
      ZenObfuscate costs $2500 for a site license or is
      individually negotiable. ZenObfuscate is a commercial  

product

Are programs written in Ruby distributable under any license you like?

Yes.

A friend of mine has proposed selling a program I wrote in Ruby but
the thought of doing so made me feel like I was leveraging vast (GPL)
resources avaliable to me for free - and profiting off of them by
adding comparatively very little. I have in the past simply sold my
development time, which seemed a fairer trade since copying my
programs is a trivial task.

Well, it is your moral system at work here. Think about those who use
GCC to compile commercial apps.

I should point out that ruby isn’t under GPL. It is under the ruby
license which allows you to make modifications or apply the GPL. See
COPYING.

Does anyone here actually sell Ruby programs themselves as products?

As the quote at the top of my announcement suggests, yes (eventually).

On Jun 13, 2006, at 4:27 AM, Kris L. wrote:

Will this work with a Rails app?

We haven’t tested obfuscating a rails app yet, but we have every
reason to believe that we can make it work. Obviously you wouldn’t
obfuscate the whole rails stack, just your controllers/models. My
only real concern is how rails does class loading magic (I’d really
want to run my tests against the obfuscated code). When we get time,
we’ll do a proof of concept against a rails app to see what issues
arise.

----- Original Message -----
From: “Ryan D.” [email protected]
To: “ruby-talk ML” [email protected]
Sent: Tuesday, June 13, 2006 5:13 PM
Subject: Re: ZenObfuscate - for when you really really have to ship a
binary

On Jun 13, 2006, at 4:27 AM, Kris L. wrote:

Will this work with a Rails app?

We haven’t tested obfuscating a rails app yet, but we have every
reason to believe that we can make it work. Obviously you wouldn’t
obfuscate the whole rails stack, just your controllers/models. My
only real concern is how rails does class loading magic (I’d really
want to run my tests against the obfuscated code). When we get time,
we’ll do a proof of concept against a rails app to see what issues
arise.

I would be very intrested in this.

On 6/13/06, Ryan D. [email protected] wrote:

On Jun 13, 2006, at 6:20 AM, John W. wrote:

Based on those limitations, I would think not.

Actually we have every reason to believe that we can obfuscate rails
apps. Obviously you wouldn’t obfuscate the whole ruby stack, but
models and controllers should de doable.

OK. For some reason I was thinking of whether you could obfuscate the
framework itself. That would be incredibly pointless, though, wouldn’t
it? :slight_smile:


Regards,
John W.

On Jun 14, 2006, at 3:23 AM, Kris L. wrote:

I would be very intrested in this.

You know how to reach us.

P.S. Be a good list citizen. PLEASE learn how to properly reply to
email.

On Jun 12, 2006, at 7:56 PM, Ryan D. wrote:

- How much does it cost and what is its licensing?
      ZenObfuscate costs $2500 for a site license or is
      individually negotiable. ZenObfuscate is a commercial  

product
produced wholly by Eric H. and Ryan D. and is not for
redistribution. All rights are reserved, etc., etc. Binaries
produced from ZenObfuscate have no restrictions of any kind
(except determined by their authors).

I should have been more clear with my English. We’re open to
negotiations for alternative licensing schemes.

On 6/14/06, Ryan D. [email protected] wrote:

On Jun 14, 2006, at 3:23 AM, Kris L. wrote:

I would be very intrested in this.

You know how to reach us.

P.S. Be a good list citizen. PLEASE learn how to properly reply to
email.

Are you talking about the indenting?
In Kris’ defense I think that’s a Microsoft mail client being used,
which makes proper netiquette an incredible chore. How I suffer under
the opression of Outlook!

Les

On 6/15/06, Ryan D. [email protected] wrote:

2 million hits… I’m sure the problem is solvable.
I have previously installed a few of these fixes and they didn’t help
much. They plugin I tried worked for new messages only, not replies.

Kris, if you have the freedom, I recommend either GMail or

Les

At Thu, 15 Jun 2006 05:50:03 +0900, Leslie V. wrote:

email.

Are you talking about the indenting?
In Kris’ defense I think that’s a Microsoft mail client being used,
which makes proper netiquette an incredible chore. How I suffer under
the opression of Outlook!

YACTTMD(*)

I think Ryan talks about the attribution novel.

----- Original Message -----
From: “Ryan D.” [email protected]
To: “ruby-talk ML” [email protected]
Sent: Tuesday, June 13, 2006 5:13 PM
Subject: Re: ZenObfuscate - for when you really really have to ship a
binary

The first, third and fifth line are superfluous and ought to be removed.
The result of this were

From: “Ryan D.” [email protected]
Sent: Tuesday, June 13, 2006 5:13 PM

which IMHO is acceptable as an approximation to the Nettiquette while
at the same time only requiring very little editing. I am unsure if

From: “Ryan D.” [email protected], Sent: Tuesday, June 13,
2006 5:13 PM

actually had any advantage over this. If one actually requires a
one-liner that should rather read

From: “Ryan D.” [email protected]

because it makes little sense to provide a time without mentioning the
time zone when writing messages to c.l.r.

IMHO the problem is the misconception that Outlook, Outlook Express
and Lotus Notes are Mail User Agents. This is wrong. They are
multi-purpose tools that include a MUA. As well as it is stupid to
expect that all the different functions of a Swiss Army Knife serve
their purpose as well as dedicated tools, it is equally stupid to
expect such multi-purpose tools to be as good as a dedicated Mail User
Agent.

To give an example the Screwdriver works fine if you have free access
to the screw. But as soon as this is not the case you run into trouble
and have to find a real screwdriver. Often as SAK is sufficient for
IKEA products but I found out that sometimes it isn’t :expressionless:

(*) Yet another contribution to this meta-discussion.

Josef ‘Jupp’ Schugt

Leslie V. wrote:

On 6/15/06, Ryan D. [email protected] wrote:

2 million hits… I’m sure the problem is solvable.
I have previously installed a few of these fixes and they didn’t help
much. They plugin I tried worked for new messages only, not replies.

Kris, if you have the freedom, I recommend either GMail or
Thunderbird — Free Your Inbox. — Thunderbird

Les

I was replying using the ruby-forum, it did not add the “>”'s even
though I used reply with quote. My bad either way. Email-wise I’m on
ThunderB… I think the web based interface to the list is mis-leading,
ruby-forum. Until recently I didn’t know it was a list.

Anyways will be in touch.

John W. wrote:

On 6/13/06, Ryan D. [email protected] wrote:

On Jun 13, 2006, at 6:20 AM, John W. wrote:

Based on those limitations, I would think not.

Actually we have every reason to believe that we can obfuscate rails
apps. Obviously you wouldn’t obfuscate the whole ruby stack, but
models and controllers should de doable.

OK. For some reason I was thinking of whether you could obfuscate the
framework itself. That would be incredibly pointless, though, wouldn’t
it? :slight_smile:


Regards,
John W.
http://johnwilger.com

It would be an advantage to compile the whole Rails framework and the
standard libary to prevent code injection. If of course possible?

On Jun 14, 2006, at 1:50 PM, Leslie V. wrote:

Are you talking about the indenting?
In Kris’ defense I think that’s a Microsoft mail client being used,
which makes proper netiquette an incredible chore. How I suffer under
the opression of Outlook!

http://www.google.com/search?q=outlook+reply+quote+fix

2 million hits… I’m sure the problem is solvable.

On 6/16/06, Kris L. [email protected] wrote:

It would be an advantage to compile the whole Rails framework and the
standard libary to prevent code injection. If of course possible?

That’s not the point of ZenObfuscate. It doesn’t turn Ruby into a
“static” language. If you want to prevent code injection, you need to
defend against it in your application.

-austin

On 6/16/06, Austin Z. [email protected] wrote:

That’s not the point of ZenObfuscate. It doesn’t turn Ruby into a
“static” language. If you want to prevent code injection, you need to
defend against it in your application.

I believe that the injection he is talking about after the application
is deployed with rails still in plain text view, having someone open
the rails files and add code that could over write methods, etc. Of
course this implies a pretty sophisticated understanding of Ruby and
the application. And also leads to a pretty difficult chain – now you
have to handle all the standard libraries that are used as well,
otherwise the same user could inject their code there as well. Don’t
forget about the RUBYOPT environment variable or even modifying the
ruby interpreter.

I am not against any of these things and may likely purchase
ZenObfuscate for our company at some point, but to base any business
model around the purity of code (in any language, but especially
dynamic languages) run on a clients machine is a mistake. You can take
some baby steps to hide stuff, but the cost/benefit ratio slips
rapidly when you try to defend against a reasonably sophisticated
attacker.

pth