Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This cipher shifts the letter that it will shift to, after each shift...

I used to play with this when I was a kid. I was thinking about it recently and realized that it wasn't as simple as I thought. Here's the description:

The second number makes the code much harder to break. It changes the number of letters above the letter to be replaced by a different amount each time. For example "a" will be subsituted by "b" (one place higher), "b" by "d" (two places higher), "c" by "f" (three places higher) and so on. Try changing the second code number in the code maker and see how much more difficult trying to break the code will be.


Is there a name for this type of shift?

share|improve this question
Can you give a quick example? I may just be tired, but for some reason I am not following the description. ... As an aside, I would expect something to do with letter shifting to be quite vulnerable; usually complex shifting schemes can be viewed (ultimately) as polyalphabetic/homophonic/polygraphic substitution ciphers (depending on the cipher in question), and there's a great deal of literature on breaking such schemes. Of course, this is just a general aside and may not necessarily apply here. – Reid Nov 4 '13 at 4:15
Sure. So if the plaintext was "abc" and the code was 01 01 then first two digits would apply a caeser shift "abc"->"bcd". But the second pair of digits say to increment each shift by one more than the previous. So the actual shift would be "abc"->"bdf". – mkg Nov 4 '13 at 4:45

So if I understand correctly, the following describes your cipher:

  • Take letters A-Z to be numbers 0-25.
  • Let Mi represent letter i of the message
  • Let Ci represent letter i of the ciphertext
  • Let n be the ceasar shift number
  • Let m be the skip number
  • Let the key be described as the tuple (n,m)
  • Then, Ci = (Mi + n + m*i) modulo 26

The system is a type of polyalphabetic cipher. The Trithemus cipher is the same as your system, but it always used a key of (0,1). Your system is also equivalent to a Vigenere cipher that uses a key that is the full alphabet, but rotated a skip number of letters.

I can't find any reference to historical use of this system, so very likely there is no standard name for this type of cipher.

This cipher is still easy to break, because there are strict limits on the numbers you can choose for the shift and skip.

  • The shift can only be from 0 to 25, because any higher numbers work the same as a number from 0 to 25.
  • The skip can also only be from 0 to 25, for exactly the same reason.
  • This means the total set of keys is 26*26 = 676

It's not hard to brute force 676 keys with a computer, but you usually don't have to. If you try all 26 skips, then you can figure out which skip is correct by doing a frequency analysis of the letters. The letter distribution that looks closest to the letter distribution of English is probably your skip. Then you just have to guess the shift based on the same frequency analysis you just did.

share|improve this answer
Even a general Vigenere cipher is pretty easy to break with low entropy plaintext, and this is just a special case of that. – Antimony Dec 21 '13 at 8:29


There isn't a specific name that describes this as an individual cipher. It is indeed a "Caesar cipher" that merely differs from the cipher Julius Caesar himself used as it uses two (or more) numbers to shift the alphabet. Looking at your description a bit closer, one could maybe even think it is somewhere half-way between a Caesar cipher and a Vigenère cipher. But from my point of view, it's nothing more than a Caesar cipher derivate.

Actually, the link you provided already tells you it is merely a Caesar cipher by stating in bold letters:

Interesting fact: the Roman Emperor Julius Ceaser used this method to hide his secret messages!

Screenshot 1


Now, as for the cryptanalysis… this may be harder to break using pen-and-paper, but in the end it has the same problems as the classic original and a bit of frequency analysis makes it possible to recover both the used "key" as well as the plaintext. Especially, when using computers to analyze.

So, "is it trivial to break?" Yes! Caesar ciphers, Vigenère ciphers, and alike classic ciphers are all pretty easy to break. Meaning: Do not use such antique, classical ciphers for anything serious!

Yet, I'm wondering why you're asking… because the link you provided already states the same:

As I said, a computer can break this code by working out what would happen for each of the code numbers and checking the resulting message against a dictionary to see if the words it has created are real words. Because it can work this out very quickly it can break the code quickly.

Screenshot 2


The Wikipedia article related to the Caesar cipher dives into the cipher, it's variants, and it's security problems it a bit more detailed. You might want to take a look at it… and while you're at it, check out the Wikipedia article related to the Vigenère cipher too as it might be interesting for you too.

Also, for a more practical view on those two ciphers, it might be interesting for you to check on sites like…

Nota Bene: There are others alike sites out there too, but I simply happened to have these links handy.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.