Skip to content

RSA - The Final Exam Mystery Cache

Hidden : 5/12/2015
Difficulty:
5 out of 5
Terrain:
1.5 out of 5

Size: Size:   micro (micro)

Join now to view geocache location details. It's free!

Watch

How Geocaching Works

Please note Use of geocaching.com services is subject to the terms and conditions in our disclaimer.

Geocache Description:


Toa Takanuva slept late. It was Sunday and raining outside. As one of tree Danish geocaching reviewers, he was often obliged to get out of bed early, but today Toa Onua was on duty, so Toa Takanuava rolled over in bed...

Somehow, he wasn't able to sleep. His mind kept coming back to the fact that his two collegues had been tricked in RSA - Mr. X attacks Toa Onua and RSA - Toa Ignika's automated reviewer service. Toa Takanuva felt sorry for them, but then again - with their level of matematical training - something like this really was to be expected!

As a former math professor and author of many publications on cryptography, this would have never happened to him...

He also thought about the new Message Center that GroudSpeak had recently introduced for geocachers. He liked the idea, but there were several shortcomings. On the usability side, many users were annoyed that you could only see a few lines of the text you were typing. Others pointed out that the limit of 1000 characters per message was simply too restrictive.

Toa's main objection to the new system was that it did not use any form of encryption. So, he pondered how RSA should be applied correctly to secure the transmission between geocachers. This way, the reviewers could even ask the Danish geocachers to use the Message Center for all communications to the reviewers.

First point was of course to make use of a safe key pair. He selected a 4096 bit public key and exponent as per below:

n=830022279216811660131142916783112532018993852499507612887731821370917661760804576640795775067097593449171513510437853769566701302387910566620037244663481295048497267374771775774270407582422879332678169616801165150905241810958164760575891883856726206907500793979649376338644972844684586571310758895597382941284480222698118997619993344497226831847684720001835138030862261735452854362882171070162545101304348125066721018020166956301534370441919406526493301549799671170990713927380864226839385378838108044449098756966990918548822482072505248926541848053045831027065884525005892908209617414750865482978047479311273259250795596228011579626054080750686313433194434957260808840769038463045306328823518571362935928147591486653455156371220120600430173559410003921767703481116585380060254129546577114806414576699821484226372931498997564496740688137654862750370455612793577636969084198214798532209805254410041927489688246226938187930975882565701381856458824858038816726969637219250887306127102300757947921747095617667639169231369821184707831094927722985601719129829801022944436853401809518572701215822723096251227012245387302730572359157319479862950415087080161321128887217383178703127688219306625557833190015252699666525428737243384981233789227
e=3

 

So, very simply, geocachers would encrypt using this public key, and the system would decode using the corresponding private key.

As Toa Ignika before him, he asked Hr. Vænge to beta-test the service. Hr. Vænge was happy to help. He prepared a message concerning his newest cache, GC5V2FW, encrypted it with the public key and sent it via E-mail. Things were great! Toa Takanuva recieved the following message:

From: Hr. Vænge, Værløse
To: Toa Takanuva, Billund
Subject: Test message for Toa
197460101074085612639126129258680060673374520489643852606977118791654676635454115671682103356048175394087557590204459031207179794387786573895902861680276421273337929723557051349552553337194552096813290216236156693182898099518707952191845055348433552418887896106121125566999018484462173447294789419448046619946948527301355868067982172402024789933894076096281246262318689591954713539841320464132141329544185707850283251516290908040263969643690381883971840010182020473411962204195269285548901458907306394134110883609097462249745499605802820270150445225805720649256147454750800054858731943800206132206503013829280878819162764335665369886294373187781834132741657247401190697148217016791491000329001427847407181782564731854640532103197486420463181673980281327772765810229304358961675768819703988499567574168151869568438851333842096326807481240086861123724270284422814654702418216345898207739254641508222296690774951685423127594001848138560721402602751062935396068920506995971918795276650702993750240035568994132524074824366824669775066892262810970582036206839783480082729760705836226088228514909404046687749201176630016980315127272469617170706317475154516391434227107167680436355065326918798021493969487889232739529692195988702708377195587

 

Having received the message, Toa Takanuva showed it to his good friend, Bjarne. Bjarne was a famous IT-person but, upon reviewing the decoded message, frowned upon the lack of structure for such messages. Bjarne suggested a standard XML schema as follows:


<?xml version="1.0">
<message>
<header>
    <subject>GCCode</subject>
    <type>MessageType</type>
</header>
<body>
Message
</body>
</message>
</?xml>

The bold fields must be substituted with the appropriate values; the value for MessageType should be set to one of:

  • GeocacherMessage: A normal message from geocacher to geocacher.
  • ReviewerMessage: A message from geocacher to reviewer.
  • ReviewerReply: A reply message from reviewer to geocacher.

Finally, Bjarne recommended that all white space (except inside Message) be removed before encryption and transmission in order to keep things simple.

Toa Takanuva approved Bjarne's suggestion and asked Hr. Vænge to resend his message using the XML format. This time, he received:

From: Hr. Vænge, Værløse
To: Toa Takanuva, Billund
Subject: Test message for Toa updated as suggested
261699405244842455508373051604071633713418738703434097940188633553733237538984410235522284746530134892008431815031624986682482762850997614525226234813250181702869162388657856085013331414697795278280685685101315480784061977732671233669149694812002171362653119617553834487806221756963402511117195844631234010723489086220655296782357795141028598398785785453914277853693501852015870127399217412849680715013398779527448281445239054636478390384835089011131585324006657323870272288273264932494286189072630580098505688396172046226383034519233761993749074356452133694721131153388866263566600643496352403024028514311861861626891102384123302314780950001208098550750365669317241056204904931805042874650326711264356962530474263976924242151107010407692108435544762402976607700058531929212309077817624384714786300403531809469631169887859484910066364921104869573332967524169971596499478408308884141342277028904285473432084905718874894429414280837071634741095371473480664305722404949135045595595588025171724437895102747917124774416027645655077734815242597564738760547376100373217931644068144713316628907169901031310852116319712509412575951866291779536870901768422523438595898382415537461751085636513222724687571243928491146663149155860093776735142977

Toa Takanuva was now happy that he had not only a secure mechanism of communications for geocaching messages. With the help of Bjarne, the mechanism was also modern in it's use of XML.

About an hour later, Toa Takanuva recieved an angry call from Hr. Vænge, who accused him of having shared the details concerning his new cache. Hr. Vænge had witnessed a woman on her bicycle stopping just in front of the cache. She had quickly retrieved the cache, signed the logbook, and disappeared. She wore a purple jacket ...

Geochecker




Extra information/hint


To make things clearer (and as a further excuse for my initial mistake on the coding of the 2nd message), let me clarity the format that Hr. Vænge uses for his 2nd message.

If the original message is 'Hello world', the message in XML format w/o whitespace becomes (one long line):


<?xml version="1.0"><message><header><subject>GC5V2FW</subject><type>ReviewerMessage</type></header><body>Hello world</body></message></?xml>

Additional Hints (Decrypt)

Guvf vf cebonoyl gur zbfg qvssvphyg EFN pnpur gung Ue. Iæatr unf rire perngrq. Vg vf gur svany rknz.

Decryption Key

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

(letter above equals below, and vice versa)