Hi --

On Wed, 2 Jun 2004, Daniel Berger wrote:

> "Ken Hilton" <kenosis / comcast.net> wrote in message news:<ub6vc.31832$js4.6571@attbi_s51>...
> > Does anyone know of a Ruby source code obfuscator that's reliable and
> > readily available?  If so, I'd appreciate a pointer to it (apparently, both
> > ruby-lang and rubygarden are down at the time of this posting so I can't
> > check for myself.)
> > 
> > Thanks in advance,
> > 
> > Ken.
> 
> This obfuscated enough?
> 
> # foo.rb
> class Foo
>    attr_accessor :arg1, :arg2
>    def initialize(arg1,arg2)
>       @arg1, @arg2 = arg1, arg2
>    end
>    def test
>       puts "Arg1 is #{@arg1}"
>       puts "Arg2 is #{@arg2}"
>    end
> end
> 
> f = Foo.new("hello","world")
> f.test
> 
> # cfoo.rb
> #(foo.rb after being encrypted with crypt-fog and a salt of 44)
> \217\230\215\237\237Lr\233\2336LLL\215\240\240\236\213\215\217\217\221\237\237\233\236Lf\215\236\223]XLf\215\236\223^
> 6LLL\220\221\222L\225\232\225\240\225\215\230\225\246\221T\215\236\223]X\215\236\223^U6LLLLLLl\215\236\223]XLl\215\23
> 6\223^LiL\215\236\223]XL\215\236\223^6LLL\221\232\2206LLL\220\221\222L\240\221\237\2406LLLLLL\234\241\240\237LNm\236\
> 223]L\225\237LO\247l\215\236\223]\251N6LLLLLL\234\241\240\237LNm\236\223^L\225\237LO\247l\215\236\223^\251N6LLL\221\2
> 32\2206\221\232\22066\222LiLr\233\233Z\232\221\243TN\224\221\230\230\233NXN\243\233\236\230\220NU6\222Z\240\221\237\2
> 40
> 
> # Running the code
> ruby -e 'require "crypt/fog";eval(Crypt::Fog.decrypt(IO.readlines("cfoo.rb").to_s.chomp,44))'
> 
> # Result
> Arg1 is hello
> Arg2 is world

This is probably a stupid question, but... what if someone did:

  ruby -e 'require "crypt/fog"; puts eval(Crypt::Fog.decrypt(......)'

?


David

-- 
David A. Black
dblack / wobblini.net