The Apis Cipher

Demonstrated here is my own variation on the classic Caesar Cipher. It makes use of couple of different tricks to obscure the message further than its inspiration, including using some ideas from ROT13 and the A1Z26 ciphers.

See if you can try figure out how it’s working!


I just think ciphers are neat! I don’t care that they’re “cryptographically weak”, they’re cool! Hiding text in plain sight is cool! Furthermore, I think there’s a lot of room for creativity in the cipher space. Take the Apis cipher for instance. It’s a combination of my favorite ciphers, but with my own personal spin. And with that personal spin it becomes more difficult to crack that just any old Caesar cipher


To save time on developing this, the cipher does have a few limitations at the moment. That said, future developments could see these limitions resolved. The most critical of these limitations is that, at this time, the cipher cannot handle any characters other than [A-Z]. It could be done, but then I may have to have the code be longer than one line ;)


Hover, or tap, below for a full explanation of how the cipher works.

  1. Split the string on spaces.
  2. For each word:
    1. Generate a key value between 0 and 25.
    2. Split the word into individual letters.
      • If the index of the letter in the word is even, left shift the letter key number of places.
      • If the index of the letter in the word is odd, right shift the letter key number of places, but return it’s numerical position in the alphabet instead (a:0 z:25).
      • Append the result to the return string
    3. Append the result to the final string

This convoluted process achieves two major goals to avoid being cracked. Firstly, the attacker could falsely assume that the key is a part of the plaintext, and in doing so would be delayed or thwarted in their attempt to find the key. Secondly, by shifting every other letter in a different direction the plaintext is further obfuscated from standard cipher decoding methods. All that said, I’m unsure how this would process holds up to more advanced decoding methods, such as frequency analysis. I believe, though, that changing the key every word may be sufficient in preventing this from becoming trivial to analyze.