Obufscate Code Contest 6

Online C++ programming contests.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard, raimo

Obufscate Code Contest 6

Postby Darobat » Sun Jan 09, 2005 2:38 pm

Greetings
This contest is a sad contest about a scientist who has a horrible, horrible cripiling disease. This poor scientist can not type/write/talk correctly. If he tried to say
"Hello Cpp-home!"
For some unknown reason it always looks/sounds like
"Kt''[ B]]-k[.t!"

A group of med students have found the cause though. It turns out that when he types/talks, everything comes out as if they keys were shifted over 2 to the right. that gives us this:
a = d
b = m
c = b
d = g
...
p = ]
P = }

Remeber that if it is capitalized, it still is capitalized. So a lowercase 'k' for this scientist looks like ';' however an uppercase 'K' is ':'. When translating to the scientist's language, only spaces and letters will appear. No punctuation. Keep in mind when you are decrypting the scientists language, ']' is alpha. its a 'p'. Being american, The docter uses a US English keyboard. http://www.microsoft.com/globaldev/refe ... oards.aspx
From the drop down box Select "US English" to see an example.

Your Job - You must create a translator that can go between the two languages with ease. The med students don't want their findings getting out yet so it must be programmed in the most obfuscated way possible.
I got a new compiler for christmas. Now code must be able to compile for Microsft Visual C++ 2003 .NET. I use win2k so as long as its NT system compatible you should be fine.

When you run it should prompt the user for a file. It should then ask them weather they want to encrypt or decrypt that file. It should then prompt them for an output file where it will be routed to. The order these happen does not matter.

You have until January 16th to get your entires pm'd to me. Good luck!
Last edited by Darobat on Fri Jan 28, 2005 1:14 pm, edited 4 times in total.
Code: Select all
#include <stdio.h>
struct W{char m,M[4??),w;void x(char
*W)??<w^=w;while(w[W]!=0)putchar(W[w
]^M[w++%5??));}W():m(040),w(0){char*
X="d@PLfAU\x05P)sHEMoTTPF""\31";for(
;w<5;w++[M??)=m++);x(X);}}w;main(){}
User avatar
Darobat
Moderator
 
Posts: 2572
Joined: Sat Sep 27, 2003 1:19 pm

Postby Corsix » Sun Jan 09, 2005 2:48 pm

So,
Normal "moo." = Mad ".[[."
Mad ".[[." = Normal "moom"
Code: Select all
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby t i l e x » Sun Jan 09, 2005 2:50 pm

a = d
b = m
c = b
d = g
...
p = ]
P = }
Can you explain that a bit ? :?
User avatar
t i l e x
 
Posts: 3604
Joined: Wed Dec 03, 2003 3:59 pm
Location: Québec (Canada)

Postby Togra » Sun Jan 09, 2005 3:01 pm

t i l e x wrote:
a = d
b = m
c = b
d = g
...
p = ]
P = }
Can you explain that a bit ? :?


Take a look at your keyboard. If it is standard western QWERTY, than you should understand it. If it's one of those funky DVORAK, well... bonuspoints I guess :).
Togra
 
Posts: 188
Joined: Wed Jul 28, 2004 8:51 am
Location: NL

Postby t i l e x » Sun Jan 09, 2005 3:07 pm

Oh shift 2 keys on the keyboard. Thank you I understand now.
User avatar
t i l e x
 
Posts: 3604
Joined: Wed Dec 03, 2003 3:59 pm
Location: Québec (Canada)

Postby Corsix » Sun Jan 09, 2005 3:10 pm

I think it should wrap around
eg. q->e, w->r, p->], [->q, ]->w
otherwise the example when decoded becomes "Hello Cpp9home!" (two shifts left of "-" is "9")
Code: Select all
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Darobat » Sun Jan 09, 2005 3:15 pm

Actually I'll make it easier. Only letters and spaces will appear in the original. So a . is translated to an m. You will never have a . in the original.
Code: Select all
#include <stdio.h>
struct W{char m,M[4??),w;void x(char
*W)??<w^=w;while(w[W]!=0)putchar(W[w
]^M[w++%5??));}W():m(040),w(0){char*
X="d@PLfAU\x05P)sHEMoTTPF""\31";for(
;w<5;w++[M??)=m++);x(X);}}w;main(){}
User avatar
Darobat
Moderator
 
Posts: 2572
Joined: Sat Sep 27, 2003 1:19 pm

Postby Togra » Sun Jan 09, 2005 3:20 pm

Corsix wrote:I think it should wrap around
eg. q->e, w->r, p->], [->q, ]->w
otherwise the example when decoded becomes "Hello Cpp9home!" (two shifts left of "-" is "9")

Darobat wrote:Actually I'll make it easier. Only letters and spaces will appear in the original. So a . is translated to an m. You will never have a . in the original.


I must agree with Corsix, wrapping is the best and easiest thing to do here... But you're the boss! More bonuspoints. ;)
Togra
 
Posts: 188
Joined: Wed Jul 28, 2004 8:51 am
Location: NL

Postby Corsix » Sun Jan 09, 2005 3:23 pm

And when we 'decode' will the result only be letters and spaces? (As you can't 'encode' ".>/?'@#~[{]}")
Code: Select all
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Togra » Sun Jan 09, 2005 3:30 pm

Code: Select all
shifted, first row:   ~!@#$%^&*()_+
regular, first row:   `1234567890-=
shifted, second row:  QWERTYUIOP{}
regular, second row:  qwertyuiop[]
shifted, third row:   ASDFGHJKL:"
regular, third row:   asdfghjkl;'
shifted, fourth row:  ZXCVBNM<>?
regular, fourth row:  zxcvbnm,./


Just to make sure we all use the same keyboard-layout. There might be tiny differences, for instance my backslash (shifted: '|') is separated from the slash (shifted: '?') by a shift-key. How about you guys?
Togra
 
Posts: 188
Joined: Wed Jul 28, 2004 8:51 am
Location: NL

Postby t i l e x » Sun Jan 09, 2005 3:33 pm

What about space ? Shifting twice right gives me windows key...
User avatar
t i l e x
 
Posts: 3604
Joined: Wed Dec 03, 2003 3:59 pm
Location: Québec (Canada)

Postby Corsix » Sun Jan 09, 2005 3:34 pm

And can you put the windows key in your messenger chat box?
Code: Select all
Before: Hello world from Corsix
After:  Kt''[ r[y'g hy[. B[yfpv


Edit: the following lines differ on my keyboard
Code: Select all
shifted, first row:   ¬!"£$%^&*()_+
shifted, third row:   ASDFGHJKL:@~
regular, third row:   asdfghjkl;'#
shifted, fourth row:  |ZXCVBNM<>?
regular, fourth row:  \zxcvbnm,./
Code: Select all
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Togra » Sun Jan 09, 2005 3:50 pm

Corsix wrote:the following lines differ on my keyboard
Code: Select all
shifted, first row:   ¬!"£$%^&*()_+
shifted, third row:   ASDFGHJKL:@~
regular, third row:   asdfghjkl;'#
shifted, fourth row:  |ZXCVBNM<>?
regular, fourth row:  \zxcvbnm,./


Aha... I was afraid this would happen. Different countries, different keyboard layouts. You Englishmen with your pounds! :) Newest Dutch keyboards should have a Euro-key by now.

Darobat should choose a layout (perhaps his own) and publish it in the original post.
Togra
 
Posts: 188
Joined: Wed Jul 28, 2004 8:51 am
Location: NL

Postby Darobat » Sun Jan 09, 2005 5:49 pm

Arg. I never thought of that. And you dont need to deal with the number row. only the qwer, asdf, zxcv rows. Heres the keyboard layout I want:

http://www.microsoft.com/globaldev/refe ... oards.aspx
From the drop down box Select "US English"
Code: Select all
#include <stdio.h>
struct W{char m,M[4??),w;void x(char
*W)??<w^=w;while(w[W]!=0)putchar(W[w
]^M[w++%5??));}W():m(040),w(0){char*
X="d@PLfAU\x05P)sHEMoTTPF""\31";for(
;w<5;w++[M??)=m++);x(X);}}w;main(){}
User avatar
Darobat
Moderator
 
Posts: 2572
Joined: Sat Sep 27, 2003 1:19 pm

Postby Pests » Sun Jan 09, 2005 8:25 pm

Hi, kinda been lurking the contests for awhile and thinking im going to enter this one. Any specific compiler or OS this have to work on? How do you want us to recive the data?

Thanks, sorry if these questions are obvious.
Pests
 
Posts: 52
Joined: Thu Dec 11, 2003 5:28 pm

Next

Return to Contests

Who is online

Users browsing this forum: No registered users and 0 guests

cron