最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
如何实现 DES 算法(全)
时间:2022-06-30 09:18:50 编辑:袖梨 来源:一聚教程网
这是摘自清华BBS的一篇文章,洋文的,小弟把它翻成中文请各位高手指点。
分号(;)后的话是小弟的翻译,井号(#)后的是小弟的一点感想。
How to implement the
Data Encryption Standard (DES)
A step by step tutorial
Version 1.2
The Data Encryption Standard (DES) algorithm, adopted by the U.S.
government in 1977, is a block cipher that transforms 64-bit data blocks
under a 56-bit secret key, by means of permutation and substitution. It
is officially described in FIPS PUB 46. The DES algorithm is used for
many applications within the government and in the private sector.
This is a tutorial designed to be clear and compact, and to provide a
newcomer to the DES with all the necessary information to implement it
himself, without having to track down printed works or wade through C
source code. I welcome any comments.
Matthew Fischer
;上面是介绍,我就不翻了。
;)
Here's how to do it, step by step:
1 Process the key.
;生成密钥
1.1 Get a 64-bit key from the user. (Every 8th bit is considered a
parity bit. For a key to have correct parity, each byte should contain
an odd number of "1" bits.)
;从用户处得到一个64位的密钥。(每8位一组,每组的第8位是校验位。如果校验
正确,每个字节应该有一个为1的
1.2 Calculate the key schedule.
;计算密钥表
1.2.1 Perform the following permutation on the 64-bit key. (The parity
bits are discarded, reducing the key to 56 bits. Bit 1 of the permuted
block is bit 57 of the original key, bit 2 is bit 49, and so on with bit
56 being bit 4 of the original key.)
;对64位的密钥进行如下的置换。(去掉校验位,密钥的实际长度是56位。置换后的
;第一位是原密钥的第57位,第二位是原第49位,第五十六位就是原来密钥的第4位。)
# 古怪的置换,哪位大哥能写出算式?
# 好象是分成两部
# for(j=57;j<64;j++)
# {
# for(i=j;i<0;i-=8)
分号(;)后的话是小弟的翻译,井号(#)后的是小弟的一点感想。
How to implement the
Data Encryption Standard (DES)
A step by step tutorial
Version 1.2
The Data Encryption Standard (DES) algorithm, adopted by the U.S.
government in 1977, is a block cipher that transforms 64-bit data blocks
under a 56-bit secret key, by means of permutation and substitution. It
is officially described in FIPS PUB 46. The DES algorithm is used for
many applications within the government and in the private sector.
This is a tutorial designed to be clear and compact, and to provide a
newcomer to the DES with all the necessary information to implement it
himself, without having to track down printed works or wade through C
source code. I welcome any comments.
Matthew Fischer
;上面是介绍,我就不翻了。
;)
Here's how to do it, step by step:
1 Process the key.
;生成密钥
1.1 Get a 64-bit key from the user. (Every 8th bit is considered a
parity bit. For a key to have correct parity, each byte should contain
an odd number of "1" bits.)
;从用户处得到一个64位的密钥。(每8位一组,每组的第8位是校验位。如果校验
正确,每个字节应该有一个为1的
1.2 Calculate the key schedule.
;计算密钥表
1.2.1 Perform the following permutation on the 64-bit key. (The parity
bits are discarded, reducing the key to 56 bits. Bit 1 of the permuted
block is bit 57 of the original key, bit 2 is bit 49, and so on with bit
56 being bit 4 of the original key.)
;对64位的密钥进行如下的置换。(去掉校验位,密钥的实际长度是56位。置换后的
;第一位是原密钥的第57位,第二位是原第49位,第五十六位就是原来密钥的第4位。)
# 古怪的置换,哪位大哥能写出算式?
# 好象是分成两部
# for(j=57;j<64;j++)
# {
# for(i=j;i<0;i-=8)
相关文章
- 以闪亮之名宠物礼包怎么样 11-25
- 崩坏星穹铁道星期日用什么光锥 11-25
- 崩坏星穹铁道星期日用什么光锥 崩铁星期日光锥推荐搭配介绍 11-25
- 崩坏星穹铁道星期日技能机制怎么样 崩铁星期日技能机制介绍 11-25
- 崩坏星穹铁道星期日遗器怎么选择 崩铁星期日遗器推荐搭配介绍 11-25
- 崩坏星穹铁道星期日怎么配队 崩铁星期日队伍推荐搭配介绍 11-25