This came to mind the other day and I'm wanting to know if there is a name for the following algorithm (I'm not sure if "cipher" is the right word for it):
- Take two consecutive letters at a time (not just one).
- Perform the A1Z26 cipher on each letter to get their position in the alphabet as numbers.
- Take the difference between those numbers obtained in the previous step.
- Convert the difference back into a letter through A1Z26 in reverse. If the difference is positive, use a capital letter. If the difference is negative, use a lowercase letter. If you encounter two of the same letter in a row (difference is 0), convert them to the letter Z, since there is no "0th" letter of the alphabet, and Z would otherwise go unused since we're taking differences (the maximum difference possible would be Z - A -> 26 - 1 = 25 -> Y). Z is always capitalized.
- Repeat until you reach the last letter, in which case you "wrap" back around from the last letter to the first.
"Hello world", for example, becomes "CgZcG HcFHs"
- H, e -> 8 - 5 = 3 -> C
- e, l -> 5 - 12 = -7 -> g
- l, l -> 12 - 12 = 0 -> Z
- l, o -> 12 - 15 = -3 -> c
- o, H -> 15 - 8 = 7 -> G
- w, o -> 23 - 15 = 8 -> H
- o, r -> 15 - 18 = -3 -> c
- r, l -> 18 - 12 = 6 -> F
- l, d -> 12 - 4 = 8 -> H
- d, W -> 4 - 23 = -19 -> s
Is there a name for this method, or a similar algorithm? What are other examples of algorithms working on not the individual letters themselves, but mathematical operations between 2+ letters?