[Math] What type of cipher is this

cryptography

I've created a type of alphabet cipher in which each character is defined based on how distant it is (in the alphabet) from the preceding character.

So, assuming that $A=0$, $B=1$, $C=2$, etc., and you have a text input of "GOOSE," you would construct the output like this:

G $(6)$ is $2$ letters in front of E $(4)$, so output is C $(2)$;
O $(14)$ is $8$ letters in front of G $(6)$, so output is I $(8)$;
O $(14)$ is $0$ letters in front of O $(14)$, so output is A $(0)$;
S $(18)$ is $4$ letters in front of O $(14)$, so output is E $(4)$;
E $(4)$ is $12$ letters in front of S $(18)$, so output is M $(12)$.

One of the benefits of this type of cipher is that, unlike a Caesar cipher, it can't be broken using normal letter-frequency analysis, since the cipher-letter that represents each actual letter is not constant throughout.

I know very little about ciphers, so I'm assuming that this type of thing has been done before.

I'm curious: Does this type of cipher have a name — and how easy is it to decipher, compared with other techniques?

Best Answer

The kind of cipher you are thinking about is called an autokey cipher. This is a polyalphabetic cipher (several encryption rules) in which the first (possibly first few) encryptions are based on some agreed-upon rule, and later encryptions are based on the text being encrypted.

The idea was originated by Girolamo Cardano (1501-1576): he would encrypt the first word of the message using a fixed key, and then for each following word he would use the first letter of the previous word as the key for encrypting the next word.

In your case, you have a collection of Caesar ciphers (alphabetic shifts), and you are selecting which Caesar cypher to use at any given step on the basis of the previous letter in the message.

Related Question