Tool to decrypt/encrypt with multiplicative encryption, a substitution cipher based on a multiplication operation.

Multiplicative Cipher - dCode

Tag(s) : Substitution Cipher

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!

A suggestion ? a feedback ? a bug ? an idea ? *Write to dCode*!

The Multiplicative Cipher (or Decimation Cipher) is an Affine cipher (ax+b) with the value b null (equal to 0), so a multiplication by $ a $.

Multiplicative encryption uses a key $ k $ (an integer) and an alphabet.

__Example:__ Encrypt `DCODE` with the key $ k = 17 $ and the 26-letter alphabet: `ABCDEFGHIJKLMNOPQRSTUVWXYZ`

Each letter is associated with its rank $ c $ in the alphabet (starting from 0).

__Example:__ `D`=3, `C`=2, `O`=14, `D`=3, `E`=4

For each character of the plain message, apply the following calculation:

$$ c \times k \mod 26 $$

($ 26 $ being the number of letters in the alphabet)

The number obtained indicates the rank in the alphabet of the corresponding numbered letter.

__Example:__ `D` = 3, so $ 3 \times 17 \mod 26 \equiv 25 $ and the letter at rank 25 is `Z`. So on for each letter, the final encrypted message is `ZIEZQ`.

Decryption can be done in 2 ways:

— Mathematically, calculate the modular inverse $ k^{-1} $ of the key modulo 26 and apply the calculation for each letter:

$$ c \times k^{-1} \mod 26 $$

__Example:__ The key $ 17 $ has the inverse modulo 26 of the value $ 23 $ so `Z` (index 25) becomes $ 25 \times 23 \mod 26 \equiv 3 $ and 3 corresponds to `D` in the alphabet.

— By substitution, in fact, during encryption each letter is associated with only one other, by calculating all the possible associations (by encrypting the 26 letters of the alphabet) then it is possible to deduce an alphabet substitution that will serve as a decryption table.

For the encryption to be reversible (so that the message can be decrypted), the key must be a coprime number with 26 (where 26 is the number of letters of the alphabet).

So there is an infinite number of possible keys, but many will give identical messages, because for a $ k $ key, then the $ k + 26 $ key gives an identical cipher.

The message is an alphabetical substitution, the frequency analysis should make it possible to find the most common letters.

The index of coincidence is unchanged from plain text.

The letter `A` remains unchanged ans id always encoded `A`

For a given alphabet, there are only a few possible keys.

The 26-letter Latin alphabet allows only 11 keys: `3`, `5`, `7`, `9`, `11`, `15`, `17`, `19`, `21`, `23` and `25` (these are coprime numbers with 26).

Key | Substitution Alphabet |
---|---|

3 | ADGJMPSVYBEHKNQTWZCFILORUX |

5 | AFKPUZEJOTYDINSXCHMRWBGLQV |

7 | AHOVCJQXELSZGNUBIPWDKRYFMT |

9 | AJSBKTCLUDMVENWFOXGPYHQZIR |

11 | ALWHSDOZKVGRCNYJUFQBMXITEP |

15 | APETIXMBQFUJYNCRGVKZODSHWL |

17 | ARIZQHYPGXOFWNEVMDULCTKBSJ |

19 | ATMFYRKDWPIBUNGZSLEXQJCVOH |

21 | AVQLGBWRMHCXSNIDYTOJEZUPKF |

23 | AXUROLIFCZWTQNKHEBYVSPMJGD |

25 | AZYXWVUTSRQPONMLKJIHGFEDCB |

There are other numbers co-prime with 26 (which are greater than 26) but they give alphabets identical to those above.

The multiplicative cipher is a simplification of the Affine cipher.

The multiplicative cipher has little interest, but it is often used for learning computer science and ciphers.

dCode retains ownership of the "Multiplicative Cipher" source code. Except explicit open source licence (indicated Creative Commons / free), the "Multiplicative Cipher" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Multiplicative Cipher" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Multiplicative Cipher" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!

Reminder : dCode is free to use.

The copy-paste of the page "Multiplicative Cipher" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!

Exporting results as a .csv or .txt file is free by clicking on the *export* icon

Cite as source (bibliography):

*Multiplicative Cipher* on dCode.fr [online website], retrieved on 2024-06-24,

- Multiplicative Cipher Decoder
- Multiplicative Encoder
- What is Multiplicative Cipher? (Definition)
- How to encrypt using Multiplicative cipher?
- How to decrypt Multiplicative cipher?
- What are the possible key values?
- How to recognize a Multiplicative ciphertext? (Identification)
- How to decipher Multiplicative cipher without key? (Attacks)
- What are the variants of the Multiplicative cipher?

multiplicative,multiplication,decimation,modulo,cipher

https://www.dcode.fr/multiplicative-cipher

© 2024 dCode — El 'kit de herramientas' definitivo para resolver todos los juegos/acertijos/geocaching/CTF.

Feedback