Obfuscated Email

On May 16, 2008, at 17:24, Matthew M. wrote:

For your task this week, I ask that you make your own signature such
that
displays your email address when run through the Ruby interpreter. The
signature must fit within four lines of no more than 80 characters
per line.
(If you still want to avoid outputting an email address, your script
may
produce something else: a phone number, a funny quote, vCard, a poem
to your
love, whatever…)

This is my first submission to a quiz, so excuse me if I mess up the
process.

My submission tried to include some easily-readable signature info,
while having all the “real” Ruby code as obfuscated as possible. The
last statement is just for fun. It’s also completely monospace (all
lines are of equal width). It only seems to work in 1.8, and I haven’t
had an opportunity to see why it fails in 1.9.

Name = “Mikael Høilund”; Email = Name.gsub %r/\s/,%#=?,# ## My current
*a=e=?=,???,:??,?,Email.downcase![eval(%["\%o\%o"]% ## phone num.
[?**2+?o,?\*2])]=“o”;Email.gsub! %%%c%*3%a, %?%c? % ?@ ## is: 1-800-
def The(s)%%%s.%%s+%.org\n.end; :Go and print The Email ## STAR-WARS.

I’m sorry about the parenthesizing warning, but it’s inevitable while
having that last statement.

Is there an upper limit to the amount of submissions a person can make?

Regards
Mikael Høilund

Here’s mine :slight_smile:

c=0;(a=“414112113123211112131141422224212312113141231215”.gsub(
/(\d)/){|k| “#{((c+=1)%2)}” * k.to_i }).gsub(Regexp.new("\d{#{
v="";l=a.size/5}}")){|k|v+=(k+"|"+k.reverse+"\n").gsub(“0”," ")
};puts v + “-#{”-“l2}” + v.reverse # Spx2 took the red pill

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mikael Høilund wrote:

| Is there an upper limit to the amount of submissions a person can make?

Only in what you can write and want to post.

Here’s my solution (only the static part of my signature):

puts “M4&AI;&QI<"!'87=L;W=S:VD@8VUD:F%C:W)Y86Y9VUA:6PN8V]M\"E1W:71T M97(Z('1W:71T97(N8V]M+V-Y;FEC86QR>6%N\"D)L;V<Z(&AT='Z+R]J=7-T
587)U8GEI<W0N8FQO9W-P;W0N8V]M”.unpack(‘u’)


Phillip G.
Twitter: twitter.com/cynicalryan
Blog: http://justarubyist.blogspot.com

~ “If people could put rainbows in zoos, they’d do it.” -Hobbes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgwYB0ACgkQbtAgaoJTgL9OJACeNqbcBOoIOyZ02dvGSKlgSbPT
sgwAn3ENN+1evpnsVcVBsbXYiNojCqrb
=AuXO
-----END PGP SIGNATURE-----

From: “Matthew M.” [email protected]

For your task this week, I ask that you make your own signature such that
displays your email address when run through the Ruby interpreter. The
signature must fit within four lines of no more than 80 characters per line.
(If you still want to avoid outputting an email address, your script may
produce something else: a phone number, a funny quote, vCard, a poem to your
love, whatever…)

Here’s my solution… (longest line is 78 characters)

Machines take me by surprise with great frequency. – Alan Turing

m=Hash[*“z_ymly_xolx_wclw_v.lv_uslu_ttlt_scls_r@lr_qklq_pllp_ollo_niln_mbl”.
scan(/(…)(…)/).flatten];t=Hash.new(“_”);i,s=0,“z”;loop{v=m[s+t[i]] or
break
s,t[i],d=v.split(//);i+=(d==“r”)?1:-1};p t.keys.sort.map{|k|t[k]}.join

As I missed last week’s quiz, I decided to combine the two and
implement a Turing Machine which would execute a program to
write my email address to the tape, the print the tape contents.

The Turing Machine program looks like this:

state, character_under_tape_head, new_state, char_to_write,

move_left_right
z_yml
y_xol
x_wcl
w_v.l
v_usl
u_ttl
t_scl
s_r@l
r_qkl
q_pll
p_oll
o_nil
n_mbl

A slightly less obfuscated version of the solution follows. (In the
signature, I omitted using temporary variables when reading and writing
the tape head t[i] .)

##–

m=Hash[*“z_ymly_xolx_wclw_v.lv_uslu_ttlt_scls_r@lr_qklq_pllp_ollo_niln_mbl”.scan(/(…)(…)/).flatten]

t=Hash.new(“_”) # the tape

i=0 # tape index (negative index is OK)

s=“z” # current state register

loop {
c = t[i]
v = m[s+c] or break
s,c,d = v.split(//)
t[i] = c
i += (d==“r”)?1:-1
}

p t.keys.sort.map{|k|t[k]}.join

##–

Regards,

Bill

Really elegant !

On Fri, May 16, 2008 at 9:24 AM, Matthew M. [email protected]
wrote:

For your task this week, I ask that you make your own signature such
that displays your email address when run through the Ruby
interpreter. The signature must fit within four lines of no more than
80 characters per line.

Interesting,

Y’know… I debated with myself whether I should have run this quiz.
Not because it wouldn’t be fun or interesting, but because I’d
actually have to read the solutions in order to write a reasonable
summary.

I feel Wednesday will be a pain in the brain.

On May 19, 2008, at 0:45, Matthew M. wrote:

Y’know… I debated with myself whether I should have run this quiz.
Not because it wouldn’t be fun or interesting, but because I’d
actually have to read the solutions in order to write a reasonable
summary.

I feel Wednesday will be a pain in the brain.

Apropos, is it customary to let a detailed breakdown accompany your
submission? Might be a problem since I sometimes can’t even remember
some of the tricks I made after a while :slight_smile:

This quiz was a lot of fun. Thanks.

z = (Math.atan(1) * 4).to_s; x =
“Suiwjw"X%Kfpw’EvtfzfwqcnsCmw}tjll/gprG”
0.upto(x.size-1) {|y| x[y] = (x[y] - z[(y+1)%z.size].chr.to_i).chr};puts
x

Apropos, is it customary to let a detailed breakdown accompany your
submission? Might be a problem since I sometimes can’t even remember
some of the tricks I made after a while :slight_smile:

It’s fine either way… Most quizzes aren’t going to be obfuscations
such as this one, so generally it’s not an issue.

Not really an issue here, either… It just means I get to have “fun”.

:wink:

On May 16, 9:24 am, Matthew M. [email protected] wrote:

to such rules, because… well, that was how things were done. For the most
signature file, out in plain view for spammers to see? It is folly, I say.
[“”] * x.size; puts x.map {z = x. ## University of Wherever I Like
For your task this week, I ask that you make your own signature such that
displays your email address when run through the Ruby interpreter. The
signature must fit within four lines of no more than 80 characters per line.
(If you still want to avoid outputting an email address, your script may
produce something else: a phone number, a funny quote, vCard, a poem to your
love, whatever…)

Here’s mine. I avoided unpack and gsub and zip so that I could write
something I can’t rely on working in the future.

srand 0; a=if defined?(RUBY_ENGINE);%w(r c y . i g i c r h r .
e t k @ a s r b - o u); elsif RUBY_PLATFORM==‘java’;%w(r s - t
i r u r k . @ r i c . o h e b c g y a); else; %w(y e t b s i @
. r i r u . o h r c c - k g a r);end;puts a.sort_by{rand}.join

Chris

Just thought I’d throw another one out there:

a,b=%Q=Z,O^NPO\r4_PV\PI\x15^-\x0\v=,email=%%%%c%115%%# Mikael
Hoilund, CTO
okay=%#;hmm=(0…a.size).map{|i|((a[i]-email[i]+2)%128).# of Meta.io
ApS from
chr}.join;!email.gsub!‘o’,“%c%c”%[3+?0.<<(2),?G.~@];aha=###########
Denmark!!
hmm.scan /#{‘(.)’*5}/;puts(email[1…-12]+aha.shift.zip(*aha).join)#
Ruby rox!

Among the hacks are:

  • The first comment isn’t a comment, but a %#…#-style string. It’s
    used as a mask over a, by subtracting the sequential characters of
    the two strings, adding two, and modulo 128’ing.
  • The string a is the Caesar-square rotated plain-text email. b
    is a dummy, incidentally assigned the same string as email.
  • foo.<<(bar) instead of foo << bar, foo.~@ instead of ~foo
  • It re-uses the email string to print the name before the email
    address, cropping the “, CTO\nokay=”.
  • It assumes UTF-8, and replaces the ‘o’ in email with “\303\270”
    for your viewing pleasure
  • It uses excessive punctuation in the comments to achieve equal
    line length. So sue me. :frowning:

For your task this week, I ask that you make your own signature such that
displays your email address when run through the Ruby interpreter. The
signature must fit within four lines of no more than 80 characters per line.
(If you still want to avoid outputting an email address, your script may
produce something else: a phone number, a funny quote, vCard, a poem to your
love, whatever…)

Is this solution OK?

require ‘net/http’
r=Net::HTTP.get_response(‘www.kakueki.com’,‘/ruby/q163.html’)
p r.body[/Ha.+sh/].gsub(“<”,“<”)+“@gmail.com>”

Harry

I’m bored;

def method_missing(m, a=0) a +
m.to_s[/[a-z]+/].size * 2; end
p What is the meaning of life?

----- Original Message -----
From: “Matthew M.” [email protected]
To: “ruby-talk ML” [email protected]
Sent: Friday, May 16, 2008 11:24 AM
Subject: [QUIZ] Obfuscated Email


For your task this week, I ask that you make your own signature such that
displays your email address when run through the Ruby interpreter. The
signature must fit within four lines of no more than 80 characters per
line.
(If you still want to avoid outputting an email address, your script may
produce something else: a phone number, a funny quote, vCard, a poem to
your
love, whatever…)

Mine is at the bottom (2 lines).
Comment:
Same code is used to encode and decode text:

def codeco s, i=0
s.gsub(/[$-{]/){%$$<<36+($&[0]-?$)*(%q<<Rj~Th>>[(i+=1)%7]-39)%88}
end

Assert: s == codeco(codeco(s,n),n)

Knowing this, you can easily create your own obfuscated signature,
just encode you text and substitute it in s=q%|…| in signature below,
use the same initial i value for encoding and decoding;

BRs

#!/bin/env ruby
s=%q|7gF99i * v]l5CV <{_ZlKJ`eW?=4Z’]Wb|
i=6;puts
s.gsub(/[$-{]/){%$$<<36+($&[0]-?$)
(%q<<Rj~Th>>[(i+=1)%7]-39)%88}

My solution is very simple:

x = [65, 110, 100, 114, 101, 119]
x.each {|x| print x.chr}

On 16 mai, 17:24, Matthew M. [email protected] wrote:

For your task this week, I ask that you make your own signature such that
displays your email address when run through the Ruby interpreter. The
signature must fit within four lines of no more than 80 characters per line.
(If you still want to avoid outputting an email address, your script may
produce something else: a phone number, a funny quote, vCard, a poem to your
love, whatever…)

Hi,

Here is my solution (I know, it’s too late, right ?) :

“ERoPHFwYCxUTGyIeHxQLFVwWDRQ=
\n”.unpack(“m*”).shift.unpack(“C*”).zip((“ruby"5).unpack("C”)).map{|
a| a[0] ^ a[1] }.pack(“C*”)

Come

On Fri, May 16, 2008 at 5:24 PM, Matthew M. [email protected]
wrote:

For your task this week, I ask that you make your own signature such that
displays your email address when run through the Ruby interpreter. The
signature must fit within four lines of no more than 80 characters per line.
(If you still want to avoid outputting an email address, your script may
produce something else: a phone number, a funny quote, vCard, a poem to your
love, whatever…)

Hi,

This is my solution. I just converted each letter in my email address
into the binary
representation of its ASCII value. The solution just reverts that
process:

puts
(“01101010011001110110000101100010011100100110100101100101011011000111100”+
“1011001110110000101101100011000010110111001000000011001110110110101100001011”+
“010010110110000101110011000110110111101101101”).
scan(/.{8}/).map{|x| x.to_i(2).chr}.join

I planned to compress the string using run-length, but I don’t the
time right now.

Jesus.

I want you guys to know that I have read all fifteen entries… Some
of the code had me confused at times, but with persistence, I managed
to figure out everything that was presented.

Well, almost everything. Mikael… I have a headache because of
you. :wink:

Summary coming tomorrow.

On 16 mai, 17:24, Matthew M. [email protected] wrote:

For your task this week, I ask that you make your own signature such that
displays your email address when run through the Ruby interpreter. The
signature must fit within four lines of no more than 80 characters per line.

My sig follows.
It uses a series of floating point divisions to build an enormous
number, which it
then breaks down 3 digits at a time to get ascii values.

I just realized that the float divisions may make it platform specific

  • on my pc, I get:
    irb(main):062:0> 1e22.to_i
    => 10000000000000000000000
    irb(main):063:0> 1e23.to_i
    => 99999999999999991611392

I suppose machines with different float representations might come up
with a different value for 1e23 and above, which will cause this sig
to print garbage results.

“Adam S., Purveyor of Fine Software, P.O. Box 42, Capitol,CA”
;d,i=?g,-1;“\a
\016\024\030\034
%)-159?”.each_byte{|e|d+=((eval"1.0e+#{e}")/[9.562,2.688,3.374,
8.902,7.741,3.162,5.098,5.428,6.278,2.845,2.495,4.989,2.844,9.1650][i+=1]).to_i}
(d,r=d.divmod(1000);$><<r.chr)while 0<d;puts; “It’s Dot Com!” =~
/H.Runner/