My hobby is Cryptograms

I've alwasy been fascinated by cool technologies for the "keepers of secrets". As a kid I dreamed of being a spy of some sort. I invented cryptic alphabets and code books. In my "Walter Mitty" moments, I have to admit, I still do.

About a year ago I stumbled across the American Cryptogram Association. This group of people has a lot of fun with Cryptograms and ciphers of all types. Their long catalogue of cipher types is a gold mine for a former crypto-kid such as myself.

What really got me hooked was

the "Solve a Cipher" page. "New Puzzle" generates a cryptogram. Clicking letters in the Ciphertext alphabet and the (hopefully) corresponding plaintext alphabet fills in the cryptogram automatically to show your progress (or your mistakes).

When you join the ACA, you get 6 issues of their magazine, the Cryptogram, per year and you get to pick a "NOM" (I love it - it makes me feel like I have a spy operational code name). This is when I first picked out "Goibhniu" as an pseudonym.

My hobby is Cryptograms, not Cryptography

I think it's worth noting that this hobby is about Cryptograms. It is a hobby. These days you can not trust your secrets to pencil-and-paper ciphers. If you're looking for information on security, check out RSA or Bruce Schneier. The stuff I'm doing here is more akin to Crowssword puzzles than security.

Aristocrats

The simplest cipher is a mono-alphabetic substitution cipher. In in the ACA, it's called an Aristocrat. One ciphertext alphabet is mapped letter for letter to one plaintext alphabet and either the ciphertext, plaintext or both alphabets are scrambled. Then each plaintext letter is substituted by its corresponding ciphertext letter in the message.

The Cryptogram contains about 25 of these per issue. When solved each reveals a cute quote. They increase in difficulty from A-1 to A-25. I've been doing them for about a year and I'm just getting to the point of finishing (almost) all of them.

According to the ACA handbook Aristocrats can be keyed in a variety of ways, but mostly it involves scrambling an alphabet thusly (A Handbook for Members of The American Cryptogram Association, page 26):

The alphabet is keyed by writing an arbitrary keyword or phrase followed by the rest of the alphabet in normal order. A letter occurring more than once is omitted after the first occurrence.
    e.g. CONSTELLATION becomes CONSTELAI.

Either the plaintext or the ciphertext alphabet may be shifted ("wrapped round") to avoid a plaintext letter standing for itself in simple substitutions.

It turns out that Perlmonks has already discussed this in this thread by Anonymous Monk: Remove repeated characters from a string

Perl and Cryptograms

This brings me back to what I'm about in this series of nodes. In the process of working on cryptograms (well, Aristocrats, as I haven't really progessed past this yet), I've heard and answered the Siren call of Perl, and I'm sure most monks have already written at least a regex (if not a full-blown module) in their heads just from reading this. Perl seems very well suited to this hobby.

In a way, I'm a little worried that Perl is too well suited to this hobby. I think a lot of PerlMonks will be asking why I haven't (or offering how I could) just solved the whole puzzle with the program. If I'm holding back it's partly because I still want to enjoy the puzzle part. What I'm presenting are more like tools for helping the human solve the cryptograms rather than solvers. Still, I wouldn't want my intent to quash creativity, so go ahead and respond with whatever your muse leads you to.

PerlMonks and Cryptograms

What I intend to do is present a topic in my cryptogram hobby in each subsequent node, discuss how I've used Perl to address that topic and invite Perl monks to improve on that idea. I have in mind about four more articles that will lead to about four different areas of Perl. Hopefully, as I progress in my hobby, I can also present more advanced uses of Perl.

Up votes or down votes don't so much matter to me (though I admit the XP system here is oddly addictive). If I had "Best Node of the year" somewhere in here and no one replied to, discussed or shared how they were inspired by it, I'd consider it a failure. What I hope to accomplish for Perlmonks is some interesting discussion and sharing of ideas.


I humbly seek wisdom.

In reply to Perl uses for Cryptograms - Part 0: Introduction (low Perl content) by goibhniu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.