Any kind of source protection?

M

Marcelo

I would like to know if there is a way to keep my source code "secret":

that's to say, that nobody can read it with a text editor (it doesn't
matter
if it can be viewed through reverse engineering).

Thanks in advance and sorry for my poor English.
 
T

Timothy Goddard

You could encode your code in base 64 then do something along the lines
of:

# Start example

require 'base64'

code = <<-END_BLOCK
cHV0cyAnSGVsbG8gV29ybGQn
END_BLOCK

eval Base64::decode64(code)

# End example

This, however, has a performance cost and is easily reverse-engineered.
The other option is to include a module written in c that performs the
functions you need to hide and only distribute the compiled code. Be
careful, however, not to link against certain libraries with more
restrictive licenses than ruby's main one.
 
G

Gene Tani

If you google groups <Search this group> for <obfuscate "source code">
or <protect "source code"> there have been several threads about what
you could do with a BSD licensed Ruby, etc. And there have been
lengthy threads also in comp.lang.python about legal/contractual
protections, how to deal with clients etc

OR llok at: Ruby2c and rubyscript2EXE. But I think basically there
isn't a hard to defeat scheme, either compiling/encrypting code, or
re-wiring the interpreter
 
G

Gene Tani

Gene said:
If you google groups <Search this group> for <obfuscate "source code">
or <protect "source code"> there have been several threads about what
you could do with a BSD licensed Ruby, etc. And there have been
lengthy threads also in comp.lang.python about legal/contractual
protections, how to deal with clients etc

OR llok at: Ruby2c and rubyscript2EXE. But I think basically there
isn't a hard to defeat scheme, either compiling/encrypting code, or
re-wiring the interpreter

there is 1 thing I haven't tried: newobfusc.rb in

http://rubystuff.org/nodewrap/doc/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,298
Messages
2,571,539
Members
48,274
Latest member
HowardKipp

Latest Threads

Top