Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Perl uses for Cryptograms - Part 0: Introduction (low Perl content)

by goibhniu (Hermit)
on Aug 28, 2007 at 18:42 UTC ( [id://635665]=CUFP: print w/replies, xml ) Need Help??

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.
  • Comment on Perl uses for Cryptograms - Part 0: Introduction (low Perl content)

Replies are listed 'Best First'.
Re: Perl uses for Cryptograms - Part 0: Introduction (low Perl content)
by graff (Chancellor) on Aug 29, 2007 at 02:30 UTC

      Very cool - I don't know much about Tk, but I'll definitely be looking into the rest of your code!


      I humbly seek wisdom.
Re: Perl uses for Cryptograms - Part 0: Introduction (low Perl content)
by klekker (Pilgrim) on Aug 29, 2007 at 09:18 UTC
    ++ for your thoughts about the voting system and of course because I'd like to read more about cryptograms (and perl).
    And because now I know the difference between cryptograms and cryptography. ;)

    k
Re: Perl uses for Cryptograms - Part 0: Introduction (low Perl content)
by pmonk4ever (Friar) on Sep 19, 2007 at 23:45 UTC
    What a cool use for Perl!

    You have inspired me to play with some of the code here. Griff's tool and your own comments along the way...

    I wound up here from Part 1, and I just had to come back and see what started such a fun sideline, hobby...

    If I had votes I would bestow them upon your nodes!

    Someday...for now I remain a novice...upon a quest for knowledge...

    Cheers! :D

    ki6jux

    "No trees were harmed in the creation of this post. However, a rather large number of electrons were somewhat inconvenienced."

      Glad to hear it. Keep learning. I look forward to you your cool uses in the future.

      Now I need to get busy with Part 2.


      I humbly seek wisdom.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://635665]
Approved by ikegami
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-25 02:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found