DES加密秘钥

1 秘钥长度

Each algorithm is designed to accept a certain key length. The key is used as part of the algorithm, and as such, can’t be whatever your heart desires.

Common key sizes are:

DES: 56bit key
AES: 128-256bit key (commonly used values are 128, 192 and 256)
RSA (assymetric cryptography): 1024, 2048, 4096 bit key

The key must have size 64-bits but only 56-bits are used from the key. The other 8-bits are parity bits (internal use).

2 校验位

DES算法的加密密钥是根据用户输入的密码生成的,该算法把64位密码中的第8位、第16位、第24位、第32位、第40位、第48位、第56位、第64位作为奇偶校验位,在计算密钥时要忽略这8位.如果输入的密码只是在这8位上有区别的话,那么操作后的结果将是一样的.
例:
输入的密码为wuzhenll,密钥的16进制表示为77 75 7A 68 65 6E 6C 6C
任意改变这64位数据的奇偶校验位,可以得到16个不同的密码,
把8个奇偶检验位全取反后:
w->v
u->t
z->{
h->i
e->d
n->o
l->m
形成新密码:vt{idomm
表面上新密码和原密码迥然不同,但是由于他们仅在奇偶校验位上有区别,所以用这两个密码进行加密解密操作得到的结果是一样的.

参考

1、How should I create my DES key? Why is an 7-character string not enough?
2、DES算法中密钥的校验位

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值