On Thu, 24 Feb 2005 01:40:13 +0900, Christian Neukirchen
<chneukirchen / gmail.com> wrote:
> Navindra Umanee <navindra / cs.mcgill.ca> writes:
> 
> > Christian Neukirchen <chneukirchen / gmail.com> wrote:
> >> > How about "pretty" and "pretty unreadable"?
> >> > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/124391
> >>
> >> Don't tell me you can't read base64! :P
> >>
> >> (It may be unreadable, but it isn't really obfuscated...)
> >>
> >> > I'm still impressed by that one (obviously)
> >>
> >> Well, thank you.
> >
> > I agree, you did some really clever work, including a generator
> > script, but in the end it's base64 and the resulting Ruby code is very
> > readable.
> >
> > I've seen people going around with a simple base64 encode/decode Ruby
> > line in their .signatures.  It's just not impressive, people!  :-)
> 
> How about:
> 
> puts [926381,23200231779,1299022,1045307475].map{|n|
> n.to_s(?$).send n%9==0&&:to_s||:capitalize}.join(" ")<<","
> 
> My favorite stays:
> 
> s=",GreEkcaSh BODybuILDER ALBreChtAMMOonIa tSUNEMATsuJ";
> puts lambda{|f|h=lambda{|h|lambda{|x|f[h[h]][x]}};h[h]}[
> lambda{|f|lambda do|h|h[0]?f[h[1..-1]]<<h[0]:[];end}][s.
> delete(*%w{A-Z ^JR})].#See King James text of the bible:
> pack("c*")## "Y do ye not understand my speech?", John 8
> 
> > Cheers,
> > Navin.
> >
> 
> srand 52019;puts"Azzp!bljqkmw!Xrfy!nmgaiq!".
> unpack(%q(c*)).map{|x|x^rand(16)}.pack('c*')

On my machine:
$ uname -a
Linux silver.wg 2.6.9silver #1 Mon Jan 10 14:43:04 CET 2005 i686 GNU/Linux
$ ruby -v
ruby 1.8.2 (2005-01-10) [i386-linux]

That evaluates to:
$ ruby -e 'srand 52019;puts"Azzp!bljqkmw!Xrfy!nmgaiq!".
unpack(%q(c*)).map{|x|x^rand(16)}.pack("c*")'
Gwvz&baf|ej}%T{a|.ikhbcw)

And I thought it was about obfuscating the code, not the answer ;)

cheers,

Brian

--
Brian Schröäer
http://ruby.brian-schroeder.de/