[QUIZ] Obfuscated Email

M

Mikael Høilund

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

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

My submission tried to include some easily-readable signature info, =20
while having all the =93real=94 Ruby code as obfuscated as possible. The =
=20
last statement is just for fun. It's also completely monospace (all =20
lines are of equal width). It only seems to work in 1.8, and I haven't =20=

had an opportunity to see why it fails in 1.9.

Name =3D "Mikael H=F8ilund"; Email =3D Name.gsub %r/\s/,%#=3D?,# ## My =
current
*a=3De=3D?=3D,!????,:??,?,,Email.downcase![eval(%["\\%o\\%o"]% ## phone =
num.
[?**2+?o,?\\*2])]=3D"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 =20=

having that last statement.

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

Regards
Mikael H=F8ilund=
 
S

Sandro Paganotti

Here's mine :)

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





For your task this week, I ask that you make your own signature such tha= t
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 opportun= ity
to see why it fails in 1.9.

Name =3D "Mikael H=F8ilund"; Email =3D Name.gsub %r/\s/,%#=3D?,# ## My cu= rrent
*a=3De=3D?=3D,!????,:??,?,,Email.downcase![eval(%["\\%o\\%o"]% ## phone n= um.
[?**2+?o,?\\*2])]=3D"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=F8ilund



--=20
Go outside! The graphics are amazing!
 
P

Phillip Gawlowski

-----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)Y86Y`9VUA: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 Gawlowski
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-----
 
B

Bill Kelly

From: "Matthew Moss said:
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] or break
s,t,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 .)

##--

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
v = m[s+c] or break
s,c,d = v.split(//)
t = c
i += (d=="r")?1:-1
}

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

##--


Regards,

Bill
 
M

Marcelo

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,
 
S

Sandro Paganotti

[Note: parts of this message were removed to make it a legal post.]

Really elegant !

From: "Matthew Moss said:
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] or
break
s,t,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 .)

##--

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
v = m[s+c] or break
s,c,d = v.split(//)
t = c
i += (d=="r")?1:-1
}

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

##--


Regards,

Bill
 
M

Matthew Moss

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.
 
M

Mikael Høilund

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 :)
 
M

Matthew Moss

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 :)

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".

;)
 
C

Chris Shea

[Note: parts of this message were removed to make it a legal post.]

_If you want to ignore the introduction and just get to the task, skip down
to the last paragraph._

Ah, yes... I remember the good ol' days of Usenet, when the signal to noise
ratio was high, very high... certainly much higher than the 1-to-100 ratio
that is the curse of many newsgroups today.

Back then we had rules! And etiquette! And people felt compelled to adhere
to such rules, because... well, that was how things were done. For the most
part, we didn't have to deal with the unrestrained spam that now pervades
the Internet net like the lingering smell of boiled cabbage.

Where was I? ..... Oh yes, signatures! We had signatures for our posts and
email, restricted to a narrow space of no more than four lines and no wider
than the terminal. We'd put our names, email, phone... even funny quotes (or
angry, political quotes for those angry, political folks). But it always fit
within four terminal lines: never more.

But nowadays... What sane person would put his email address in his
signature file, out in plain view for spammers to see? It is folly, I say.
Insanity. Lunacy. I would sooner code in BASIC than publicly divulge my
email address to the world.

Now, I hear you say, "So, genius, how do you provide such information if not
in the signature?" Well, you are right to ask and also right to call me a
genius. Pay attention, and I shall reveal to you how such is accomplished
(best viewed in monospaced font):

x = ("swDlw ms > mMm.hh@ttaiog" + ## Matthew D Moss, 888-555-1234
"<.cMmssoottaaee").split(//); z = ## Department of Fine Ruby Studies
[""] * x.size; puts x.map {z = x. ## University of Wherever I Like
zip(z).sort }.last[9].join + "\n" ## "He that runs Ruby, runs well."

Do you see it? You don't, do you? Look again after I run this signature
through the Ruby interpreter:

Matthew D Moss <[email protected]>

The silence suggests to me that you are stunned beyond words. I think you
are needing such a challenge...

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
 
M

Mikael Høilund

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-email+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. :(
 
H

Harry Kakueki

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("&lt;","<")+"@gmail.com>"

Harry
 
S

Sergey Volkov

----- Original Message -----
From: "Matthew Moss" <[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 <{_Z*lKJ`eW?=4Z']Wb|
i=6;puts s.gsub(/[$-{]/){%$$<<36+($&[0]-?$)*(%q<<Rj~Th>>[(i+=1)%7]-39)%88}
 
M

Mikael Høilund

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?
 
J

Jesús Gabriel y Galán

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.
 
A

APNelson.L

My solution is very simple:

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

come

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
 
A

Adam Shelly

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 Shelly, 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/
 
M

Matthew Moss

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. ;)

Summary coming tomorrow.
 

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
473,780
Messages
2,569,607
Members
45,241
Latest member
Lisa1997

Latest Threads

Top