Do you remember how, for most ciphers, you and your recipient must agree on a shared key? Well… here’s a cipher without a randomly-generated key. This isn’t the most easily usable cipher, but it works, you know?

This cipher takes the message, shifts a couple letters from the end to the beginning, and uses it as the key.

That’s it.

Essentially, it becomes a one-time pad without a randomly-generated key or a pseudorandomly-generated key.

The flaw?

Well, this cipher depends on knowing the message to decrypt the cipher. But if that’s the case, we might as well just not use a cipher. We know the message already, so why bother?

That’s where our little key comes in. Before the ciphertext is sent, send a fairly small number (preferably 1), and when the ciphertext is sent, add at the end of the ciphertext the letters that were moved to create the key, The number of shifted letters must be the same as the chosen number. For example, to encrypt HELLO WORLD with a shift of one, the key would be DHELL OWORL, and the ciphertext would be KLPWZ KKFCO, but since we moved the D from the end to the front, it would be KLPWZ KKFCOD.

How do we decrypt this?

Since we know that the first letter of the key is D, we subtract D from K, which leaves us with H. Now, we know that this is the second letter of the key, so we subtract H from L, leaving us with E. It goes on and on and on… and the cipher is decrypted.

But what if an eavesdropper managed to figure out that the number that was sent was related to the key? Well, we could fix that. You remember how the ciphertext was KLPWZ KKFCO, and we shifted one letter? Instead of sending a separate number, we could send it with the ciphertext. Now, we could send KLPWZ KKFCODA, and to find the key, look at the last letter. The last letter is how many letters are shifted – A is 1, B is 2, etc. – and if you remove the letter at the end and count that many letters, that is the shift for the key.

Weird? Yes.

Practical? Absolutely not.

Why is this not practical? That’s because you are reading this right now, and therefore you know about this cipher. That means you know exactly how to decrypt any ciphertext, which means I can’t use this anymore.

But if I come up with a different way… then you’ll never catch me.