Skip to content

Crypto Cache # 7 - Modular Arithmetic Mystery Cache

Hidden : 11/20/2005
Difficulty:
4.5 out of 5
Terrain:
2.5 out of 5

Size: Size:   small (small)

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:

The above coordinates are NOT the location of the cache. You either like this kind of cache and find it interesting or you don’t … oh, well.

Much computer encryption makes use of modular arithmetic, also called clock arithmetic in elementary school, and one-way functions. One-way functions are easy to perform in one direction but harder or impossible to perform in the reverse, or require a different set of rules.

In this cache I’ll tell you exactly how I encrypted the cache coordinates—your job is to reverse the process.

Instead of substituting one letter for another letter in the alphabet, I used trigraphs, three-letter groups of letters, and assigned them numbers. The number of possible trigraphs (different ways of putting three letters of the alphabet together) is 26^3 or 17,576. The trigraph ‘aaa’ is given the number 0. The trigraph ‘zzz’ is 17,575.

For example, to convert the trigraph ‘PAL’ into a number, I would use the following formula. ‘P’ is the fifteenth letter of the alphabet (remember, ‘A’ is zero), ‘A’ is zero, and ‘L’ is the eleventh letter. Therefore to encrypt them:

= (15 * 26^2) + (0 * 26^1) + (11 * 26^0)

which solves as

= 10140 + 0 + 11

= 10151

So the number corresponding to the trigraph ‘PAL’ would be 10151. I could just use trigraph numbers to hide a cache but that would have been too easy, wouldn’t it? We’ll call the number we got, in this case 10151, the ‘plaintext’ number or ‘P’.

Modular arithmetic, also called clock arithmetic, is what we use when we tell time. A clock has twelve numbers. For modular arithmetic we always start at zero. What time would it be fourteen hours from now? Two o’clock since we’d go around the clock once and get back to two. In modular arithmetic, the answer is the remainder, the amount left over after we wrap around the clock as many times as we can.

A clock would be modular 12 written ‘mod 12’.

14 mod 12 = 2 since you’d go around the clock once and have a remainder of 2.

What is 27 mod 12? Well, we’d wrap around the clock twice and have a remainder of 3. Therefore

27 mod 12 = 3

But we can also do modular arithmetic using any number as the modulus or base. Imagine a clock with 26 numbers. What would be the answer to

577 mod 26

See how many times 26 goes evenly into 577. It goes 22 times with a remainder of 5. Therefore

577 mod 26 = 5

Here are a few more. Make sure you understand how to get the correct answer before proceeding.

5 mod 12 = 5

1234 mod 891 = 343

(55 * 22) mod 91 = 27

So next in this cryptogram I encrypted the plaintext trigraph number using the following modular arithmetic formula. ‘C’ stands for ciphertext or in this case, the ciphertext number.

C = (159 * P) mod 17,576

Let’s do it with the plaintext number (P) we got for ‘PAL’.

C = (159 * 10151) mod 17,576

C = (1,614,009) mod 17,576

See how many times 17,576 goes into 1,614,009 and determine the remainder. It goes in there 91 times with a remainder of 14593. The remainder is the answer.

C = 14593

I could give you a list of all the ‘C’ numbers but I went a step farther.

Next I converted my ciphertext number (C) into a trigraph itself. In this case, we convert 14593 into its corresponding trigraph.

= (x * 26^2) + (y * 26^1) + (z * 26^0)

Calculate how many times 26^2 (or 676) goes into 14593. It goes 21 times so our first number (far left number) in our trigraph is 21.

21 * 676 = 14196

This leaves us with 397

14593 - 14196 = 397

Calculate how many times 26^1 (or 26) goes into 397. It goes 15 times so our second number is 15.

15 * 26 = 390

This leaves us with 7

397 - 390 = 7

So our final third number is 7.

= (21 * 26^2) + (15 * 26^1) + (7 * 26^0)

= 21 15 7

Converting these numbers into their respective alphabet letters—
(again, remember A is 0 and Z is 25)

21 = V 15 = P 7 = H

Therefore, my original trigraph of ‘PAL’ is encrypted as ‘VPH’.

Okay, so here’s the cryptogram giving the cache location encrypted in the same way. The hard part—I guess among other things—is figuring out (researching) how to reverse the modular arithmetic formula.

XRYQVUMZNJVMHUPMHZEIREIRKISKMQ
NCVKFJYEJBIIFLYKQPXJMZLZTJYONNALM

Additional Hints (No hints available.)