A PowerShell Cryptogram

The Chairman is back with another challenge, this one probably more on the harder end. Although once you get your head around how to solve it, you’ll probably find it pretty easy. Your challenge is to solve a cryptogram like this, presumably using PowerShell.

$crypto = @"
g - 2 5 R e t o p c 7 -
h v 1 Q n e l b e d E p

Inside this string block is a hidden message. To solve or decrypt, you need a pair of numbers, X and Y. Starting in the upper left you would start counting X number of characters, starting at 1. Once you have the first letter then count Y number of characters for the 2nd letter. Then X number of characters for the 3rd letter and so on. The end result will be a word or phrase with no spaces. But it should be recognizable to you

In this sample, the solution is 1,5. You would start counting at 1 for the first letter. Then count 5 for the next, 1 for the next and so on.

Do you see the hidden message?

Ready for a challenge? Find the hidden message in this cryptogram. You’ll have to discover the key intervals. It could be 2,6 or 3,8 or 6,2. To make it easier, the cryptogram is written so that you do not have to loop around.

$crypto = @"
P k T r 2 s z 2 * c F -
r a z 7 G u D 4 w 6 U #
g c t K 3 E @ B t 1 a Y
Q P i c % 7 0 5 Z v A e
W 6 j e P R f p m I ) H
y ^ L o o w C n b J d O
S i 9 M b e r # ) i e U
* f 2 Z 6 M S h 7 V u D
5 a ( h s v 8 e l 1 o W
Z O 7 l p K y J l D z $
- j I @ t T 2 3 R a i k
q = F & w B 6 c % H l y

Once you discover the correct intervals, the message should be self-evident.

In order to give everyone a chance to solve this, please don’t submit any answers as comments. They won’t be published. But you are welcome to submit links to your work and solution.

24 Replies to “A PowerShell Cryptogram”

    • Jason Colotario

      Definitely fastest way, leave $x constant and $y– on while loop to grind down the cryptograph to the correct phrase.

    • John Steele

      I must have been testing the original code in a stale environment because as soon as I tried it in a fresh Powershell session I was getting tons of errors. I was improperly looping through the interval values. I’ve updated the loop code and it works as expected now.

  1. G-Money

    A few suggestions I would like to pass on after getting the answer:
    – The answer is not provided; you will have to loop (manually or in code) to find the interval.
    – Treat characters at the beginning of a lower line as connected to the one above it. In the example, the answer is found with characters 1,6,7,12,13,18,19,24 not with characters 1,6,7 and 12 from lines 1 and 2.

    I got the solution quickly, but finding the interval really threw me for a loop. I would take “It could be 2,6 or 3,8 or 6,2. To make it easier, you do not have to loop around.” out of the challenge description as it almost implies the solution is one of those 3 and you gave us a head start (this made me really second guess my code for a while).

    The example also gave me the impression like I might need to either process each line in the script block separately then combine the results or connect them and process them like a single collection. I thought this because both methods of coding against a connected list and coding against each line of the string block worked with the example. See my second suggestion above for help with this thought.
    Best of luck,

Comments are closed.