Virginia Code table
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/78/14/wKioL1Z1WwDBEaHWAAGY7UKfZSE837.jpg "title=" 3ac79f3df8dcd100d56d833d748b4710b9122f3c.jpg "alt=" Wkiol1z1wwdbeahwaagy7ukfzse837.jpg "/>
=============================================
#维吉尼亚密码 encryption
key= ' HelloWorld '
plaintext= ' Whereisthekey '
#key = ' Relations '
#plaintext = ' Tobeornottobeth '
Ascii= ' ABCDEFGHIJKLMNOPQRSTUVWXYZ '
Keylen=len (Key)
Ptlen=len (plaintext)
ciphertext = ' '
i = 0
While I < ptlen:
j = i% Keylen
K = Ascii.index (Key[j])
m = Ascii.index (Plaintext[i])
Ciphertext + = ascii[(m+k)%26]
i + = 1
Print ciphertext
===================================================================
#维吉尼亚加密算法 decryption
key= ' HelloWorld '
ciphertext= ' Dlpcsegkshrij '
#key = ' Relations '
#ciphertext = ' ksmehzbblk '
Ascii= ' ABCDEFGHIJKLMNOPQRSTUVWXYZ '
Keylen=len (Key)
Ctlen=len (ciphertext)
plaintext = ' '
i = 0
While I < ctlen:
j = i% Keylen
K = Ascii.index (Key[j])
m = Ascii.index (Ciphertext[i])
If M < k:
M + = 26
plaintext + = Ascii[m-k]
i + = 1
Print plaintext
This article is from the "Personal Records" blog, so be sure to keep this source http://whbill.blog.51cto.com/3280780/1726430
The Virginia cipher Plus decryption program written by Python