On Wed, Apr 17, 2002 at 01:31:16AM +0900, Rik Hemsley wrote:
> 
> Something like this, perhaps. (Write 'decrypt' in C):
> 
> --------------------------------
> def crypt code
>   [ code ].pack("m")
> end
> 
> def decrypt buf
>   buf.unpack("m").to_s
> end
> 
Ok for now, but actual implementation use something
like DES3. 

> module Kernel
> 
>   alias oldload load
> 
>   def load(aFileName, wrap=false)
>     if (aFileName =~ /.rx$/)
>       puts "Loading encrypted file"
>       File.open(aFileName) { |f|
>         eval decrypt(f.read)
>       }
>     else
>       oldload(aFileName, wrap)
>     end
>   end
> 
> end
> 
> load 'test.rx'
> ------------------------------
> 
> Quite lame, but I don't care :)

No, not lame. A good start.
The C code would also be a wrapper around the ruby
code, so no (simple) access could be had.

Good. Now take what you have done and write it in ruby C. :)


-- 
Jim Freeze
If only I had something clever to say for my comment...
~