# Obfuscated Email (#163)

**URL:** <https://www.ruby-forum.com/t/obfuscated-email-163/138421>\
**Category:** Ruby\
**Created:** [May 22, 2008, 9:25pm UTC](https://www.ruby-forum.com/t/obfuscated-email-163/138421 "2008-05-22T21:25:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mansfiem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Post date:** [May 22, 2008, 9:25pm UTC](https://www.ruby-forum.com/t/obfuscated-email-163/138421/1 "2008-05-22T21:25:35Z")

</div>

Welcome, Ruby coders and coderettes… Tonight we bring you the Obfu  
Awards,  
awards given by committee (i.e. me) to those most deserving for their…  
“creative” work.

We’re going to skip the red carpet frivolities, as we have no red  
carpet,  
and jump right to the awards. Here they are, in no particular order  
(except  
that of their entry).

#### Best Non-Working But Terribly Obvious Solution

This award goes to _DJ Jazzy L._ whose solution – while it  
generates  
an error – provides output that can be discerned by running the Ruby  
interpreter in your mind. Seeing as how Google provides wonderful spam  
filtering, thanks to at least fifteen Python hackers, the l

#### Most Prolific Use of `gsub` in a Signature

_John J._ puts forth a straightforward, easy to understand, solution  
that  
is his email address transformed by simple replacements. Not terribly  
obfuscated, but a good first step, and I believe the greatest number of  
calls to `gsub` within a single solution.

#### Best Unexpected Use of `String#Unpack`

_Harry K._ makes interesting use of `String#unpack` by way of its  
directional and positional directives. While his attempts to confuse the  
source material were unsuccessful, his use of these uncommon `unpack`  
commands are worthy of notice.

#### Most Painful Obfuscation

The first entry from _Mikael Hoilund_ is such a dangerous minefield of  
string manipulations and punctuation, the committee could not completely  
discern its operation. In particular, putting aside the call to  
`downcase!`  
(which we managed to discern after much coffee and doses of Ritalin),  
this  
segment of code was never fully understood:

```
*a=e=?=,!????,:??,?,,Email

```

We’d ask Mikael to explain himself to the committee, but we fear the  
medical  
consequences.

#### Best Looking Non-Email Output

Rather than provide his email address, _Sandro P._ chose to  
display  
his logo, specified in a run-length encoded string, specifying alternate  
sections of “on” or “off” characters. A couple reverses and flips here  
and  
there grows the logo and generates more output than code was input.

#### Highest Data-to-Code Ratio

_Phillip G._ receives this honor, for using a simple `unpack` to  
decode his UUEncoded name, email address and web pages.

#### Special Award: Solving Two Quizzes In One

A very special honor goes to _Bill K._ for a finely golfed solution  
to  
two quizzes at the same time. His tiny Turing Machine not only works,  
but  
fits both the machine and the code required to print his email address  
within the space restriction for this quiz. Bravo.

#### Most Rentable Space (and Use of Non-Standard Number Bases)

_Marcelo Magallon_’s use of a base-36 number, simply converted to ASCII  
(base-256) did not fool the committee, but it was quite elegant.

#### The “I Like Π” Award

A cute and curious technique, _Steven Hahn_ used the digits of π to  
offset the characters of his email address. Sadly, we were hoping for  
lemon  
meringue.

#### Best Abuse of a Random Number Generator

Random numbers are supposed to be random… except when they’re not.  
_Chris  
Shea_ puts this to use to ensure the scrambled letters of his email  
address  
are shuffled into the correct place. The need to vary this per-platform  
is a  
sad consequence, due to variations in the generators.

#### The “Thank Goodness He Provided An Explanation” Award

Once again, _Mikael Hoilund_ taunts us… or should I say, _haunts_ us.  
We  
tried, we really tried, to understand his code before giving up and  
reading  
the (thankfully) provided explanation. After that, we were able to  
follow  
along and understand the code, and have come to two conclusions. First,  
Mikael has taught us how to abuse those we don’t like. Second, Mikael  
should  
not be allowed near the `%` character ever again.

#### Best Gratuitous Use of the Web

For his second entry, _Harry K._ places a portion of his email  
address  
on the web, and another portion in the code, a simple `GET` and `gsub`  
completes the address.

#### Most Obfuscated Code (Well, Except for that Mikael Guy… You Know

Who  
We’re Talking About…)

_Sergey V._ presents a markedly obfuscated bit of code that is  
characterized by his self-inverting transform. The use of `$&` made  
available by the regular expression, instead of a parameter for the  
`gsub`  
block, was tricky. Using `%$$` as an empty string for converting ASCII  
values to single-character strings was a clever ruse. We wonder if we  
shouldn’t take away the `%` character from Sergey as well.

#### Best Attempt to Scare the Committee

Seeing _Mikael Hoilund_’s third submission, we fretted. At first, no one  
dared to look. But as we are gluttons for punishment, we relented, only  
to  
see this silly attempt to print “42”. Still, we worry what might happen  
if  
we ask Mikael to write a spreadsheet or calculator.

#### Longest Binary Sequence Seen In A Submission to this Quiz

Congratulations to _Jesus Gabriel_. It’s the longest binary sequence.  
We’re  
fairly certain of that.

#### Most Obvious Need for an ASCII Table

The solution provided by _Andrew Nelson_ was simple, quaint, obvious.  
And we  
all know 65, but can never remember 110 or 114. Google, I’m feeling  
lucky  
about “ASCII table”.

#### Best XOR Decryption of a Base-64 String to an ASCII String in a

Ruby  
Quiz

The award goes to _Come Milan_ for… well… doing what I just said.  
Next!

#### The “Is It Unstable? I Forget How Floating-Point Works” Award

Our final award goes to _Adam S._ who does some things to  
floating-point  
numbers, then a few more things, then makes them integers and gets a  
remainder… or something… but anyway it works, but will it work  
everywhere? Who knows?

Overall, a lot of great submissions. I most _definitely_ learned some  
things  
here.

There will not be any quiz provided tomorrow. Family is coming into  
town.  
See you again in a week!

---

<div class="post-metadata">

**Author:** ![mansfiem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Post date:** [May 22, 2008, 9:37pm UTC](https://www.ruby-forum.com/t/obfuscated-email-163/138421/2 "2008-05-22T21:37:20Z")

</div>

Matthew M. wrote:

> Google, I’m feeling lucky about “ASCII table”.

I learned something cool today: “man ascii” provides an ASCII table.

-Dana

---

<div class="post-metadata">

**Author:** ![mansfiem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Post date:** [May 22, 2008, 10:06pm UTC](https://www.ruby-forum.com/t/obfuscated-email-163/138421/3 "2008-05-22T22:06:49Z")

</div>

On May 22, 2008, at 2:24 PM, Matthew M. wrote:

> that of their entry).  
> Your summaries are always more fun than mine were! 😉

> \*a=e=?=,???,:??,?,Email
> 
> We’d ask Mikael to explain himself to the committee, but we fear the  
> medical  
> consequences.

Ouch. Let’s break it down.

First we need to get it to run:

> > Email = Object.new  
> > =\> #Object:0x389190
> 
> > \*a=e=?=,???,:??,?,Email  
> > =\> [61, 63, 44, #Object:0x389190]

It’s just a really complex assignment, we can see.

\*a = …

Slurp an Array into the variable a.

… e = …

And store the first value of that Array in e.

… ?=, …

The ASCII value of the character = (61).

This next bit is very tricky. I had to play with it in IRb a bit to  
figure out how Ruby parses it, but it plays out as:

… !?? ? ?, : ??, …

The conditional is the opposite of the ASCII value of ? (always true,  
which not switches to false). If it was true, it would become the  
ASCII value of , (44). However, since it’s always false it becomes  
the ASCII value of ? (63).

The last bit is much easier:

… ?, Email

That’s just the ASCII value of , (44), followed by the contents of the  
Email constant.

James Edward G. II

---

<div class="post-metadata">

**Author:** ![mansfiem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Post date:** [May 24, 2008, 9:02pm UTC](https://www.ruby-forum.com/t/obfuscated-email-163/138421/4 "2008-05-24T21:02:46Z")

</div>

On Thu, May 22, 2008 at 2:24 PM, Matthew M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Welcome, Ruby coders and coderettes… Tonight we bring you the Obfu Awards,  
> awards given by committee (i.e. me) to those most deserving for their…  
> “creative” work.

I didn’t contribute because I can’t keep up with you people :). But  
I’ll say it was a great quiz and an awesome summary. Thanks, Matthew!

Todd

---

<div class="post-metadata">

**Author:** ![mansfiem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Post date:** [May 25, 2008, 8:32pm UTC](https://www.ruby-forum.com/t/obfuscated-email-163/138421/5 "2008-05-25T20:32:18Z")

</div>

On Sun, May 25, 2008 at 12:02 AM, Matthew M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> my original file.
> 
> And, sadly, my brain doesn’t work all that well anymore. 😉 I can’t  
> remember what I had intended to say. Once I come up with something  
> clever, I’ll fix the web site.

It was however a brilliant quiz, and a brilliant summary, I however  
had a brilliant??? idea too, but I need a year to answer the quiz ☹  
The idea was Gödelizing my signature into one very biiiig number,  
expressing this biiig number in a clever expression that would  
fit the quiz size constraints and ungödelizing would just take half of  
a line or even less.  
However factorizing the biiig number is not an option, and so I was  
trying to create products out of the first 10000 primes and then I  
might find some clever expressions using them, but even that will take  
weeks :(.

## Cheers Robert

[http://ruby-smalltalk.blogspot.com/](http://ruby-smalltalk.blogspot.com/)

* * *

Whereof one cannot speak, thereof one must be silent.  
Ludwig Wittgenstein

---

<div class="post-metadata">

**Author:** ![mansfiem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Post date:** [May 25, 2008, 12:03am UTC](https://www.ruby-forum.com/t/obfuscated-email-163/138421/6 "2008-05-25T00:03:29Z")

</div>

> This award goes to _DJ Jazzy L._ whose solution – while it generates  
> an error – provides output that can be discerned by running the Ruby  
> interpreter in your mind. Seeing as how Google provides wonderful spam  
> filtering, thanks to at least fifteen Python hackers, the l

I was reading over the summary I wrote, and I don’t know what happened  
to the rest of this paragraph. Must have accidentally killed a line or  
two in vim, 'cause the complete paragraph isn’t on the website nor in  
my original file.

And, sadly, my brain doesn’t work all that well anymore. 😉 I can’t  
remember what I had intended to say. Once I come up with something  
clever, I’ll fix the web site.

---

<div class="post-metadata">

**Author:** ![mansfiem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Post date:** [May 25, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/obfuscated-email-163/138421/7 "2008-05-25T20:39:20Z")

</div>

Robert D. wrote:

> It was however a brilliant quiz, and a brilliant summary, I however  
> had a brilliant??? idea too, but I need a year to answer the quiz ☹  
> The idea was Gödelizing my signature into one very biiiig number,  
> expressing this biiig number in a clever expression that would  
> fit the quiz size constraints and ungödelizing would just take half of  
> a line or even less.  
> However factorizing the biiig number is not an option, and so I was  
> trying to create products out of the first 10000 primes and then I  
> might find some clever expressions using them, but even that will take  
> weeks :(.

In other words, you had a brilliant solution to the problem, but it did  
not fit in the margin of your email? Oh, we have heard that one before!  
😉

---

<div class="post-metadata">

**Author:** ![mansfiem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Post date:** [May 25, 2008, 10:05pm UTC](https://www.ruby-forum.com/t/obfuscated-email-163/138421/8 "2008-05-25T22:05:15Z")

</div>

> In other words, you had a brilliant solution to the problem, but it did not  
> fit in the margin of your email? Oh, we have heard that one before! 😉  
> If I had known that I would not have bothered you, well actually I  
> have never seen such a bold claim before :P…  
> But it did not fit in the time frame.  
> R
