A word is converted into a code by a rule. Compare letters position by position to find the rule, then apply it to the new word.
1Common codes
Shift each letter forward or backward by k places
Reverse the word
Opposite letters (A ↔ Z, B ↔ Y: positions add up to 27)
Letter positions as numbers, or their sum
Combinations of the above