Assume the letters A-Z are labeled by 0, … , 25 and the blank is labeled by 26, i.e. the alphabet with a blank is identified with the ring . We define the key of an affine cryptosystem to be
, where
and
, which defines an enciphering transformation
Example 1: Encipher the message “WELCOME TO THE NEW AGE” using an affine cryptosystem with the key .
Step 1: Translate the message to the labeling in :
Step 2: Apply the encipher transformation:
Step 3: Translate the message back to the alphabet from the labeling:
Example 2: Decipher the message “WBSFH BHSFHXBO” if we assume we have an affine cryptosystem enciphered with the key . The deciphering key is given by:
.
Step 1: Translate the encypted message to the labeling in :
Step 2: Apply the decipher transformation.
Step 3: Translate the message back to the alphabet from the labeling: