English 中文(简体)
Multiplicative Cipher
  • 时间:2024-12-22

Multippcative Cipher


Previous Page Next Page  

While using Caesar cipher technique, encrypting and decrypting symbols involves converting the values into numbers with a simple basic procedure of addition or subtraction.

If multippcation is used to convert to cipher text, it is called a wrap-around situation. Consider the letters and the associated numbers to be used as shown below −

Associated Numbers

The numbers will be used for multippcation procedure and the associated key is 7. The basic formula to be used in such a scenario to generate a multippcative cipher is as follows −

(Alphabet Number * key)mod(total number of alphabets)

The number fetched through output is mapped in the table mentioned above and the corresponding letter is taken as the encrypted letter.

Encrypted Letter

The basic modulation function of a multippcative cipher in Python is as follows −

def unshift(key, ch):
   offset = ord(ch) - ASC_A
   return chr(((key[0] * (offset + key[1])) % WIDTH) + ASC_A)

Note − The advantage with a multippcative cipher is that it can work with very large keys pke 8,953,851. It would take quite a long time for a computer to brute-force through a majority of nine milpon keys.

Advertisements