# Encrypting source / application licensing

**URL:** <https://www.ruby-forum.com/t/encrypting-source-application-licensing/55456>\
**Category:** Rails\
**Created:** [March 21, 2006, 7:49am UTC](https://www.ruby-forum.com/t/encrypting-source-application-licensing/55456 "2006-03-21T07:49:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![janovetz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@janovetz](https://www.ruby-forum.com/u/janovetz)\
**Post date:** [March 21, 2006, 7:49am UTC](https://www.ruby-forum.com/t/encrypting-source-application-licensing/55456/1 "2006-03-21T07:49:01Z")

</div>

Hey folks-

If I wanted to distribute my code to users that would run the code on  
their own machine, how could I go about encrypting the source to run on  
a user’s machine?

PHP has the Zend Encoder among others, I believe. Is there anything  
similar for Ruby?

Jake

---

<div class="post-metadata">

**Author:** ![janovetz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@janovetz](https://www.ruby-forum.com/u/janovetz)\
**Post date:** [March 21, 2006, 12:59pm UTC](https://www.ruby-forum.com/t/encrypting-source-application-licensing/55456/2 "2006-03-21T12:59:11Z")

</div>

Jake J. wrote:

> Hey folks-
> 
> If I wanted to distribute my code to users that would run the code on  
> their own machine, how could I go about encrypting the source to run on  
> a user’s machine?
> 
> PHP has the Zend Encoder among others, I believe. Is there anything  
> similar for Ruby?  
> Not yet. Expect that to happen soon after Ruby 2.0 gets released (I  
> don’t know of any specific projects, but there’s a market force and the  
> architecture should allow it). The current Ruby interpreter doesn’t do  
> a bytecode compilation, so there’s no intermediate to save.

---

<div class="post-metadata">

**Author:** ![janovetz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@janovetz](https://www.ruby-forum.com/u/janovetz)\
**Post date:** [March 21, 2006, 6:39pm UTC](https://www.ruby-forum.com/t/encrypting-source-application-licensing/55456/3 "2006-03-21T18:39:51Z")

</div>

Alex Y. wrote:

> Jake J. wrote:
> 
> > Hey folks-
> > 
> > If I wanted to distribute my code to users that would run the code on  
> > their own machine, how could I go about encrypting the source to run on  
> > a user’s machine?
> > 
> > PHP has the Zend Encoder among others, I believe. Is there anything  
> > similar for Ruby?  
> > Not yet. Expect that to happen soon after Ruby 2.0 gets released (I  
> > don’t know of any specific projects, but there’s a market force and the  
> > architecture should allow it). The current Ruby interpreter doesn’t do  
> > a bytecode compilation, so there’s no intermediate to save.

Great. Thanks. I remembered reading about a bytecode implementation  
but I wasn’t entirely sure how that would fit in.

It seems that some folks have been able to reverse the Zend Encode  
stuff. Is that a bytecode implementation or some other form of  
decrypt-before-interpret thing?

Jake

---

<div class="post-metadata">

**Author:** ![janovetz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@janovetz](https://www.ruby-forum.com/u/janovetz)\
**Post date:** [March 21, 2006, 6:46pm UTC](https://www.ruby-forum.com/t/encrypting-source-application-licensing/55456/4 "2006-03-21T18:46:42Z")

</div>

Not to make light of what you’re trying to do, but most commercial Java  
applications (including the one that pays for my salary) are trival to  
reverse engineer and no one worries about it much. The various  
solutions  
are limited and bring their own headaches.

Are you sure you need to hide your code?

---

<div class="post-metadata">

**Author:** ![janovetz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@janovetz](https://www.ruby-forum.com/u/janovetz)\
**Post date:** [March 21, 2006, 6:52pm UTC](https://www.ruby-forum.com/t/encrypting-source-application-licensing/55456/5 "2006-03-21T18:52:58Z")

</div>

Jake J. wrote:

> It seems that some folks have been able to reverse the Zend Encode  
> stuff. Is that a bytecode implementation or some other form of  
> decrypt-before-interpret thing?  
> Looks like bytecode to me, although I haven’t played with it myself.

---

<div class="post-metadata">

**Author:** ![janovetz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@janovetz](https://www.ruby-forum.com/u/janovetz)\
**Post date:** [March 21, 2006, 6:53pm UTC](https://www.ruby-forum.com/t/encrypting-source-application-licensing/55456/6 "2006-03-21T18:53:36Z")

</div>

Larry W. wrote:

> Not to make light of what you’re trying to do, but most commercial Java  
> applications (including the one that pays for my salary) are trival to  
> reverse engineer and no one worries about it much. The various  
> solutions  
> are limited and bring their own headaches.
> 
> Are you sure you need to hide your code?

Locks on a house, I guess. You get rid of a lot of folks just by having  
some mild deterrant.

How does the Google Appliance protect their source? Or the Joyent  
Connector?
