# Protecting Ruby Code as Intellectual Property

**URL:** <https://www.ruby-forum.com/t/protecting-ruby-code-as-intellectual-property/63979>\
**Category:** Ruby\
**Created:** [June 20, 2006, 10:53pm UTC](https://www.ruby-forum.com/t/protecting-ruby-code-as-intellectual-property/63979 "2006-06-20T22:53:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [June 20, 2006, 10:53pm UTC](https://www.ruby-forum.com/t/protecting-ruby-code-as-intellectual-property/63979/1 "2006-06-20T22:53:06Z")

</div>

Good People,

Short of removing all whitespace and running one’s script a single block  
of text, how can one protect one’s code as intellectual property in,  
say, a commercial environment? Is there a means to hide or protect  
code, or do you have to port it to a language such as C or C++ in order  
to do this? Thanks for your attention to this matter.

David B.

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [June 20, 2006, 11:04pm UTC](https://www.ruby-forum.com/t/protecting-ruby-code-as-intellectual-property/63979/2 "2006-06-20T23:04:49Z")

</div>

See [ANN: ZenObfuscate - for when you really really have to ship - Ruby - Ruby-Forum](http://www.ruby-forum.com/topic/69161#90229)

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [June 21, 2006, 12:19am UTC](https://www.ruby-forum.com/t/protecting-ruby-code-as-intellectual-property/63979/3 "2006-06-21T00:19:23Z")

</div>

On Tue, 20 Jun 2006 23:04:29 +0200, Simen E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> See [ANN: ZenObfuscate - for when you really really have to ship - Ruby - Ruby-Forum](http://www.ruby-forum.com/topic/69161#90229)

And also [http://ruby2cext.rubyforge.org/](http://ruby2cext.rubyforge.org/)

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [June 21, 2006, 5:46pm UTC](https://www.ruby-forum.com/t/protecting-ruby-code-as-intellectual-property/63979/4 "2006-06-21T17:46:27Z")

</div>

David B. wrote:

> Short of removing all whitespace and running one’s script a single block  
> of text, how can one protect one’s code as intellectual property in,  
> say, a commercial environment?

It seems this is as much a legal question as a technical one. The  
best ideas that come to my mind are: patents on your most important  
IP, NDAs with your customers, good legal review of your license  
agreements, etc. Note that lots of commercial software has  
source code available with the right legal documents in place[1].

> Is there a means to hide or protect code, or do you have to  
> port it to a language such as C or C++ in order  
> to do this? Thanks for your attention to this matter.

Perhaps, but those will probably do little to protect your IP.  
In reality it’ll be hard for people outside your organization  
to maintain your actual codebase in any language even if you  
provide all the source and detailed documentation to help them;  
and if all they want to do is extract particular algorithms,  
that’s not hard to reverse engineer from binaries.

[1] [http://www.microsoft.com/resources/sharedsource/Licensing/GSP.mspx](http://www.microsoft.com/resources/sharedsource/Licensing/GSP.mspx)

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [July 8, 2006, 2:38am UTC](https://www.ruby-forum.com/t/protecting-ruby-code-as-intellectual-property/63979/5 "2006-07-08T02:38:29Z")

</div>

David B. wrote:

> Good People,
> 
> Short of removing all whitespace and running one’s script a single block  
> of text, how can one protect one’s code as intellectual property in,  
> say, a commercial environment? Is there a means to hide or protect  
> code, or do you have to port it to a language such as C or C++ in order  
> to do this? Thanks for your attention to this matter.

This has been discussed various times, some quite recently, on this  
mailing list. You should be able to find what you need by searching the  
mailing list archives.

–  
James B.

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

- Richard P. Feynman
