52ky 发表于 2022-9-27 09:32:58

DES算法及其在VC++6.0下的实现

官方C/C++开发工程师(1090119),验证请输入您的ID。本代码具体演示了DES算法,包括了明文及密钥二进制的表明。DES算法把64位的明文输入块变为64位的密文输出块,它所使用的密钥也是64位,其算法首要分为两步:1初始置换其功能是把输入的64位数据块按位重新组合,并把输出分为L0、R0两部分,每部分各长32位,其置换规则为将输入的第58位换到第一位,第50位换到第2位……依此类推,最后一位是本来的第7位。L0、R0则是换位输出后的两部分,L0是输出的左32位,R0是右32位,例:设置换前的输入值为D1D2D3……D64,则通过初始置换后的成果为<imgsrc="sweat.gif"smilieid="10"border="0"alt=""/>0=D58D50……D8;R0=D57D49……D7。2逆置换通过16次迭代运算后,得到L16、R16,将此作为输入,进行逆置换,逆置换正好是初始置换的逆运算,由此即得到密文输出。
DES_zyj\res\DES加解密算法.ico
DES_zyj\res\DES加解密算法.rc2
DES_zyj\DES加解密算法.clw
DES_zyj\DES加解密算法.cpp
DES_zyj\DES加解密算法.dsp
DES_zyj\DES加解密算法.dsw
DES_zyj\DES加解密算法.h
DES_zyj\DES加解密算法.opt
DES_zyj\DES加解密算法.rc
DES_zyj\DES加解密算法Dlg.cpp
DES_zyj\DES加解密算法Dlg.h
DES_zyj\resource.h
DES_zyj\StdAfx.cpp
DES_zyj\StdAfx.h
DES_zyj\密钥二进制表明.dat
DES_zyj\明文二进制表明.dat

(Official C/C   development engineer (1090119), please enter your ID for verification. This code specifically demonstrates the DES algorithm, including the plaintext and key binary representation. The DES algorithm changes the 64-bit plaintext input block into a 64-bit ciphertext output block, and the key it uses is also 64-bit. The block is recombined bit by bit, and the output is divided into two parts, L0 and R0, each part is 32 bits long. And so on, the last digit is the original 7th. L0 and R0 are the two parts after transposition output, L0 is the left 32 bits of the output, and R0 is the right 32 bits. For example, if the input value before the transposition is set to D1D2D3...D64, the result after the initial transposition is < imgsrc="sweat.gif"smilieid="10"border="0"alt=""/>0=D58D50……D8;R0=D57D49……D7. 2 After 16 iterations of inverse permutation, L16 is obtained , R16, take this as the input, perform inverse permutation, which is just the inverse operation of the initial permutation, thus obtaining the ciphertext output.
DES_zyj\res\DES encryption and decryption algorithm.ico
DES_zyj\res\DES encryption and decryption algorithm.rc2
DES_zyj\DES encryption and decryption algorithm.clw
DES_zyj\DES encryption and decryption algorithm.cpp
DES_zyj\DES encryption and decryption algorithm.dsp
DES_zyj\DES encryption and decryption algorithm.dsw
DES_zyj\DES encryption and decryption algorithm.h
DES_zyj\DES encryption and decryption algorithm.opt
DES_zyj\DES encryption and decryption algorithm.rc
DES_zyj\DES encryption and decryption algorithm Dlg.cpp
DES_zyj\DES encryption and decryption algorithm Dlg.h
DES_zyj\resource.h
DES_zyj\StdAfx.cpp
DES_zyj\StdAfx.h
DES_zyj\keybinary indicates.dat
DES_zyj\plaintext binary indicates .dat)




页: [1]
查看完整版本: DES算法及其在VC++6.0下的实现