Trivia about Vigenère

2K 33 4
                                    

Did you know?

Vigenère can also be described algebraically. If the letters A–Z are taken to be the numbers 0–25 (i.e., A=^0{\displaystyle A{\widehat {=}}0}A \widehat{=} 0, B=^1{\displaystyle B{\widehat {=}}1}{\displaystyle B{\widehat {=}}1}, etc.), and addition is performed modulo 26, then Vigenère encryption E{\displaystyle E}E using the key K{\displaystyle K}K can be written,

Ci=EK(Mi)=(Mi+Ki)mod26{\displaystyle C_{i}=E_{K}(M_{i})=(M_{i}+K_{i})\mod {26}}C_i = E_K(M_i) = (M_i+K_i) \mod {26}
and decryption D{\displaystyle D}D using the key K{\displaystyle K}K,

Mi=DK(Ci)=(Ci−Ki)mod26{\displaystyle M_{i}=D_{K}(C_{i})=(C_{i}-K_{i})\mod {26}}M_i = D_K(C_i) = (C_i-K_i) \mod {26},
where M=M1…Mn{\displaystyle M=M_{1}\dots M_{n}}M=M_{1}\dots M_{n} is the message, C=C1…Cn{\displaystyle C=C_{1}\dots C_{n}}C=C_{1}\dots C_{n} is the ciphertext and K=K1…Kn{\displaystyle K=K_{1}\dots K_{n}}K=K_{1}\dots K_{n} is the key obtained by repeating the keyword ⌈n/m⌉{\displaystyle \lceil n/m\rceil }\lceil n/m\rceil  times, where m{\displaystyle m}m is the keyword length.

Thus using the previous example, to encrypt A=^0{\displaystyle A{\widehat {=}}0}A \widehat{=} 0 with key letter L=^11{\displaystyle L{\widehat {=}}11}L \widehat{=} 11 the calculation would result in 11=^L{\displaystyle 11{\widehat {=}}L}11 \widehat{=} L.

11=(0+11)mod26{\displaystyle 11=(0+11)\mod {26}}11 = (0+11) \mod {26}
Therefore, to decrypt R=^17{\displaystyle R{\widehat {=}}17}R \widehat{=} 17 with key letter E=^4{\displaystyle E{\widehat {=}}4}E \widehat{=} 4 the calculation would result in 13=^N{\displaystyle 13{\widehat {=}}N}13 \widehat{=} N.

13=(17−4)mod26{\displaystyle 13=(17-4)\mod {26}}13 = (17-4) \mod {26}
In general, let Σ{\displaystyle \Sigma }\Sigma  be the alphabet of length ℓ{\displaystyle \ell }\ell . Denote by m{\displaystyle m}m the length of key. Then Vigenère encryption and decryption can be written as follows:

Ci=EK(Mi)=(Mi+K(imodm))modℓ,{\displaystyle C_{i}=E_{K}(M_{i})=(M_{i}+K_{(i\mod m)})\mod \ell ,}{\displaystyle C_{i}=E_{K}(M_{i})=(M_{i}+K_{(i\mod m)})\mod \ell ,}
Mi=DK(Ci)=(Ci−K(imodm))modℓ.{\displaystyle M_{i}=D_{K}(C_{i})=(C_{i}-K_{(i\mod m)})\mod \ell .}{\displaystyle M_{i}=D_{K}(C_{i})=(C_{i}-K_{(i\mod m)})\mod \ell .}
Note that Mi{\displaystyle M_{i}}M_{i} denotes the offset of the i-th character of the plaintext M{\displaystyle M}M in the alphabet Σ{\displaystyle \Sigma }\Sigma . For example, taking the 26 English characters as the alphabet Σ=(A,B,C,…,X,Y,Z){\displaystyle \Sigma =(A,B,C,\cdots ,X,Y,Z)}{\displaystyle \Sigma =(A,B,C,\cdots ,X,Y,Z)}, the offset of A is 0, and the offset of B is 1, etc. Ci{\displaystyle C_{i}}C_{i} and Ki{\displaystyle K_{i}}K_{i} are similar.

© Wiki

DETECTIVEWhere stories live. Discover now