I’ve been a computer programmer since the early 70’s, about the time I became enamoured with cryptanalysis. Writing computer programs to aid my cryptanalytic research has been invaluable to me throughout this entire period. Sure, I have spent delectable hours solving ACA-type cryptograms by hand. When I worked on more serious ciphers in university, however, computers have always been invaluable and time-saving.
My first cryptanalytic programs were written in PL/1 and ran on IBM mainframes. The speed of these babies matched that of modern day PCs. In the 80’s I “graduated” to PCs running compiled C code and the occasional AWK scripting program to help analyze and solve more sophisticated ciphers.
For many years my cryptanalytic scripting language of choice was AWK. When all I wanted to do was parse the ciphertext, perform a frequency count, and perform some complex analysis, a scripting language is light enough for the classic edit-run-debug loop.
A few years later I moved on to Perl. Here was a scripting language that let me do anything I pleased in a minimal amount of coding time. My research output increased significantly and I was able to produce important results I could never have done by hand.
An example of results I could never have done manually is the initial work I did on John F. Byrne’s Chaocipher. Sifting through the 13,300+ characters of Exhibit 1, looking for pt/ct identities, plaintext and ciphertext double letters, isormorphs, trawling a pattern through the plaintext or ciphertext looking for a match, performing statistical calculations, simulating alternative cipher models and enciphering the 13,300+ plaintext characters — these are only a few of the tasks that scream out for automation using computers.
Recently I spent time trying to solve a single ADFGVX ciphertext challenge message. The tremendous amount of tedious and error-prone computations and calculations needed to match columns would take days to perform, so I wrote some help program (in Perl) that let me concentrate on the analysis without getting bogged down in the “drudgery”.
Up-and-coming cryptanalytic techniques we’re seeing more and more are Hill-Climbing and Simulated Annealing (SA). You can only take advantage of these powerful methods if you can write a program to do it for you.
You don’t need to study Advanced Computer Science to be able to write computer programs. Pick a language (e.g., Perl, C, C++, Ruby, Python, Visual Basic, Java) and start writing simple programs: reading text from a file, taking a frequency count, writing to standard output, manipulating characters and strings, loops, and performing mathematical calculations. In a short time you will have mastered everything you need to write cryptanalytic aids.
Don’t worry if you don’t know the difference between a double-linked list and a B-tree. Just program the method you would use if you were solving it by hand. This alone will cut your solving time by 1-2 magnitudes.
In my opinion, every cryptanalyst should know how to write computer programs to ease the work. And I believe anyone can acquire that skill.
Don’t lose out on advancing in the world of Classical Cryptanalysis because the problem key space is too large for manual solution and you can’t program. Take that step, come on into the modern world, and let your cryptanalytic achievements soar.

July 3, 2009 at 11:07 pm |
Hi,
Can you pls tell me which course to intiate for cryptography.I have a keen interest on cryptography but am an commerce graduate and would like to know the basic course for beginners as i can take it frm there,Pls advise.
Thanks & Regards
Rupa.
July 6, 2009 at 9:18 am |
Hi Rupa,
You’ve caught me unprepared! My advice about learning how to program by learning a small programming language still stands. What I think I need to do is write a series of blog postings describing the rudiments of a particular programming language (which one?), then showing how to write simple but powerful cryptographic and cryptanalytic programs solving real ciphers.
So, with your permission, I will author a series of lessons on writing cryptographic/cryptanalytic computer programs (I’ll need to decide which programming language to use). A possibility is to post the series on The Crypto forum for a more appropriate venue (BTW, you will find very interesting cryptologic discussions there).
In any case, I will post a blog entry here announcing the availability of the series.
Thank you for raising the issue and pushing me to take this important step.
Moshe
July 6, 2009 at 11:09 am |
Hi,
Thanks for your prompt response.I really appreciate your efforts to encourage and help beginners like me.I am also looking forward to your lessons.Will you post it on the same blog or please send me the link..
Thanks & Regards
Rupa.
July 6, 2009 at 11:20 am |
Hi Rupa,
I’ll decide soon where to publish the series, but I will most certainly post an entry on Jerusalem Mosaics pointing to the eventual location.
Thanks again,
Moshe
July 8, 2009 at 8:51 pm |
Hi Rupa,
I’m sure Moshe will provide an excellent Tutorial, drawing on his expert knowledge of both cryptology and computer programming.
While he is preparing his articles you might like to have a look at a Tutorial I’ve prepared for beginners on programming with Python. Python is a modern, high-level language which is easy to learn and free to download. I am also a keen cryptologist and have written the Tutorial with cipher-solving in mind.
If you are interested, have a look at my website
http://web.me.com/mikejcowan/Ciphers/Welcome.html
Osric