[Challenge] Secret Decoder Ring

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

[Challenge] Secret Decoder Ring

Post by McInfo »

Challenge: Write a script to decode the following message.

Code: Select all

+F(+S#W|Y1Q|Y%T*X<dtT1d$F2J;H.F~P!I;Y$J;H+I!r;.*d+W J.d0T;U.T2J;Y$F0d5T1d$F2J;X+Q2J d0M!d,Z6_(J;\%Y$T1Y;X,T%Q%S#d%Y;K+W;J2J.^+S!d!Q/JGd5T1d)Z/Y;I+\*Q+F d|d}F L!d|S d|Y0F~M;N0d%S;F;W!U(^;U+X0r;9$J.J;F.J;Y$W!J;G|I#J/dCL+Q p;X%Q2J.p;F*I;G.T*_!m;Y+d}J;H(F%R!I;F0d0M%X;F I.J/XUd$Y0UUsJX*^ J2r~T)sKu"tO{|vQI!z w}zQKTFQyRt"IMxQyOxIdoM|S'X;K+W;U(F5N*LI
Hints:
  • The first two characters are special and are not part of the decoded message.
  • The encoder uses a substitution cipher with a "twist".
  • The alphabet is made up of keyboard characters (ASCII 32-126).
If no one cracks the code in a few days, I will post some more hints.

Edit: This post was recovered from search engine cache.
Last edited by McInfo on Tue Jun 15, 2010 11:32 am, edited 1 time in total.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: [Challenge] Secret Decoder Ring

Post by Eran »

now this is a challenge :)
I don't know if I'll have time to take a crack at this, but nice one!
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: [Challenge] Secret Decoder Ring

Post by jackpf »

Damn, that's hard. :P
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: [Challenge] Secret Decoder Ring

Post by McInfo »

It looks like it's time for another hint.

Code: Select all

+ , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~   ! " # $ % & ' ( ) *

F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~   ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E
Edit: This post was recovered from search engine cache.
Last edited by McInfo on Tue Jun 15, 2010 11:34 am, edited 1 time in total.
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: [Challenge] Secret Decoder Ring

Post by McInfo »

SPOILER ALERT!

As I mentioned in my first post, the alphabet is made up of 95 ASCII characters from 32 (space) to 126 (tilde):

Code: Select all

  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~
The first and second characters of the encoded string ("+" and "F") correspond to two randomly-chosen positions in the alphabet. If you line up two copies of the alphabet so that these two positions are aligned, you get the decoder table that I showed in my last post. The alphabets wrap around as if they were written on the side of a cylinder so that each character in one alphabet is matched with a character in the other alphabet. So, if you take the third character from the encoded message, which is "(", and look for it in the top alphabet, you find the first character of the decoded message, "C", in the bottom alphabet. The "twist" of this algorithm is that the bottom alphabet is now where you look up the next encoded character and the top alphabet is where you find the corresponding decoded character. This means that if you look for the next encoded character, "+", you will find that the matching decoded character is "o". This flipping behavior occurs for every character.

Edit: This post was recovered from search engine cache.
Last edited by McInfo on Tue Jun 15, 2010 11:35 am, edited 1 time in total.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: [Challenge] Secret Decoder Ring

Post by Benjamin »

That's cool. I attempted to decode it using character offsets but that did not work.
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: [Challenge] Secret Decoder Ring

Post by McInfo »

This challenge is certainly distancing itself from the others to claim its place as the oldest unsolved challenge. Is it that it's too difficult or just that no one is motivated to solve it? Did I mention that there are prizes* for the first three people to solve it? I took some of the challenge away by explaining the algorithm, but I'm still expecting someone to post a solution.

*Prizes have no monetary value.

Edit: This post was recovered from search engine cache.
Last edited by McInfo on Tue Jun 15, 2010 11:36 am, edited 1 time in total.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: [Challenge] Secret Decoder Ring

Post by Eran »

I think since it's more a puzzle than a programming challenge, it require more mental preparation / investment since the way to solve it is not clear. I know that I couldn't find the motivation to really tackle it..
mischievous
Forum Commoner
Posts: 71
Joined: Sun Apr 19, 2009 8:59 pm

Re: [Challenge] Secret Decoder Ring

Post by mischievous »

Hey McINfo i sent you PM ... check it out.

:crazy:
watson516
Forum Contributor
Posts: 198
Joined: Mon Mar 20, 2006 9:19 pm
Location: Hamilton, Ontario

Re: [Challenge] Secret Decoder Ring

Post by watson516 »

I spent a few minutes and did this challenge. It was a pretty interesting one.

My solution only work with php 5.3.0 + as it uses strstr with the third argument to create the first and second string patterns.

As requested in the above 'encrypted' message, here is my badge.

Image

[edit]

I did post the code but I figured that would kind of make the whole badge thing pointless and the time it took McInfo to make the webpage a waste of time so I will upload my code at a later time.
Last edited by watson516 on Tue Sep 08, 2009 12:59 pm, edited 2 times in total.
frozenarmageddon
Forum Newbie
Posts: 19
Joined: Wed Aug 05, 2009 6:29 pm

Re: [Challenge] Secret Decoder Ring

Post by frozenarmageddon »

I think I got it, I am good at the theory part, but pretty new at the coding...
I'm gonna take a try in it see if I get to solve it :P
If I will I think I will be the most newbie to solve an advanced puzzle :P
but lets not get ahead of ourselves, shall we ^^
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: [Challenge] Secret Decoder Ring

Post by McInfo »

Good work, watson516! I'm glad someone finally completed the challenge. Thanks for un-posting your code for now. When two more people solve it we can share solutions.

mischievous actually decrypted the message first, but it must have been manually because there were some missing characters so the link didn't work for him, which was what the PM was about.

Good luck, frozenarmageddon.

Edit: This post was recovered from search engine cache.
Last edited by McInfo on Tue Jun 15, 2010 11:37 am, edited 1 time in total.
frozenarmageddon
Forum Newbie
Posts: 19
Joined: Wed Aug 05, 2009 6:29 pm

Re: [Challenge] Secret Decoder Ring

Post by frozenarmageddon »

By the way, is there any more winners? or the silver and bronze "medals" are still available?
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: [Challenge] Secret Decoder Ring

Post by McInfo »

watson516 is the only one who has claimed a badge so far. The silver and bronze are still available.

Edit: This post was recovered from search engine cache.
Last edited by McInfo on Tue Jun 15, 2010 11:37 am, edited 1 time in total.
frozenarmageddon
Forum Newbie
Posts: 19
Joined: Wed Aug 05, 2009 6:29 pm

Re: [Challenge] Secret Decoder Ring

Post by frozenarmageddon »

I think I am going to give up :\
I just don't understand what is happening and what I am doing wrong... What I code just won't work as I expect it to...
And asking for help... well.. count's as if I didn't do it, but someone else did... :\
Post Reply