文件名称:vigenere
介绍说明--下载内容均来自于网络,请自行研究使用
计一个vigenere密码类,类的对象各自拥有不用的密匙。用不用对象加密相同的明文,将会获得不同的密文。加密过程如下:设密匙为K=k1k2.......kn,明文为M=m1m2.......mn,密文为C=c1c2.......cn,其中k1k2.........kn,m1m2...........mn,
c1c2.........cn,每个都代表一个字母。
将字母A到Z编号,从0到25,那么它们之间有这样的对应关系:ci=(mi+ki)mod26。
例如,M=data security,K=best,那么首先将M分解成长为4的序列:data secu rity
每一节都使用密匙K=best进行加密,得到序列:EELT TIUN SMLR
将明文的空格添加进去,就得到密文:EELT TIUNSMLR出于密码体制的需要,密文中的字母全部使用大写字母。-Account for one vigenere password class, class of objects do not have the keys of their respective owners. No object with the same plaintext encrypted, the ciphertext will be different. Encryption process is as follows: Let key as K = k1k2 ....... kn, expressly for the M = m1m2 ....... mn, the ciphertext is C = c1c2 ....... cn, where k1k2 ......... kn, m1m2 ........... mn, c1c2 ......... cn, each of which represents a letter. The letters A to Z number, from 0 to 25, then they have such a corresponding relationship between the: ci = (mi+ ki) mod26. For example, M = data security, K = best, then the first M sequence of decomposition of the growth of 4: data secu rity each section using the encryption key K = best, be sequences: EELT TIUN SMLR add the plaintext space go to get the ciphertext: EELT TIUNSMLR the need for cryptography, ciphertext letter in all uppercase letters.
c1c2.........cn,每个都代表一个字母。
将字母A到Z编号,从0到25,那么它们之间有这样的对应关系:ci=(mi+ki)mod26。
例如,M=data security,K=best,那么首先将M分解成长为4的序列:data secu rity
每一节都使用密匙K=best进行加密,得到序列:EELT TIUN SMLR
将明文的空格添加进去,就得到密文:EELT TIUNSMLR出于密码体制的需要,密文中的字母全部使用大写字母。-Account for one vigenere password class, class of objects do not have the keys of their respective owners. No object with the same plaintext encrypted, the ciphertext will be different. Encryption process is as follows: Let key as K = k1k2 ....... kn, expressly for the M = m1m2 ....... mn, the ciphertext is C = c1c2 ....... cn, where k1k2 ......... kn, m1m2 ........... mn, c1c2 ......... cn, each of which represents a letter. The letters A to Z number, from 0 to 25, then they have such a corresponding relationship between the: ci = (mi+ ki) mod26. For example, M = data security, K = best, then the first M sequence of decomposition of the growth of 4: data secu rity each section using the encryption key K = best, be sequences: EELT TIUN SMLR add the plaintext space go to get the ciphertext: EELT TIUNSMLR the need for cryptography, ciphertext letter in all uppercase letters.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
vigenere.cpp