caesar: Julius would be proud

Dropping back to bsd-games again, here’s caesar:


caesar decrypts text encoded with a caesar cipher, an ancient letter substitution system. If you remember when we talked about rot13, caesar does much the same thing, but doesn’t necessarily pirouette along the 13th character, like rot13 does.

caesar includes a measure of calculation though, using the statistical values of common English letters to find the most likely answer. I should mention that — given the fact that caesar will pick the statistical best answer, but not necessarily the intelligible one — it’s fairly easy to confound caesar. Give it a short word like WCRIVKC and caesar replies with FLARETL, when the correct answer is “synergy.”

It’s forgivable though. With a long enough string of normal English text, caesar will likely give the right answer, no matter what shift you apply. I tried two different encryptions of “Now is the time for …” and caesar decoded it correctly, each time.

I mention all this as a measure of praise for the program; I wouldn’t trust the cipher itself too far in this day and age. Of course, you might be able to find a few modern uses that don’t involve love notes between primary school children. 😉