Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Vigenère cipher
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Algebraic description == Vigenère can also be described algebraically. If the letters <code>A</code>–<code>Z</code> are taken to be the numbers 0–25 (<math>A \,\widehat{=}\, 0</math>, <math>B \,\widehat{=}\, 1</math>, etc.), and addition is performed [[modular arithmetic|modulo]] 26, Vigenère encryption <math>E</math> using the key <math>K</math> can be written as :<math>C_i = E_K(M_i) = (M_i+K_i) \bmod 26</math> and decryption <math>D</math> using the key <math>K</math> as :<math>M_i = D_K(C_i) = (C_i-K_i) \bmod 26,</math> in which <math>M = M_1 \dots M_n</math> is the message, <math>C = C_1 \dots C_n</math> is the ciphertext and <math>K = K_1 \dots K_n</math> is the key obtained by repeating the keyword <math>\lceil n / m \rceil</math> times in which <math>m</math> is the keyword length. Thus, by using the previous example, to encrypt <math>A \,\widehat{=}\, 0</math> with key letter <math>L \,\widehat{=}\, 11</math> the calculation would result in <math>11 \,\widehat{=}\, L</math>. :<math>11 = (0+11) \bmod 26</math> Therefore, to decrypt <math>R \,\widehat{=}\, 17</math> with key letter <math>E \,\widehat{=}\, 4</math>, the calculation would result in <math>13 \,\widehat{=}\, N</math>. :<math>13 = (17-4) \bmod 26</math> In general, if <math>\Sigma</math> is the alphabet of length <math>\ell</math>, and <math>m</math> is the length of key, Vigenère encryption and decryption can be written: :<math>C_i = E_K(M_i) = (M_i+K_{(i \bmod m)}) \bmod \ell,</math> :<math>M_i = D_K(C_i) = (C_i-K_{(i \bmod m)}) \bmod \ell.</math> <math>M_i</math> denotes the offset of the ''i''-th character of the plaintext <math>M</math> in the alphabet <math>\Sigma</math>. For example, by taking the 26 English characters as the alphabet <math>\Sigma = (A,B,C,\ldots,X,Y,Z)</math>, the offset of A is 0, the offset of B is 1 etc. <math>C_i</math> and <math>K_i</math> are similar.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Vigenère cipher
(section)
Add topic