Tag: 奇偶校验

使用JavaScript扩展DESKey

我在Node.js中实现一个协议 该协议在CBC模式下使用3DESencryption,没关系。 但要encryption/解密,我需要扩大/扩大14个字节的DES密钥到16个字节只是添加奇偶校验位。 但。 我坚持使用JavaScript / Node.js。 我有一些使用C和Python的实现,任何人都可以帮助我使用JavaScript / Node.js(我的试用版下面)做同样的事情? uint8 *des_key_spread(uint8 *normal){ static uint8 spread[16]; spread[ 0] = normal[ 0] & 0xfe; spread[ 1] = ((normal[ 0] << 7) | (normal[ 1] >> 1)) & 0xfe; spread[ 2] = ((normal[ 1] << 6) | (normal[ 2] >> 2)) & 0xfe; spread[ 3] = ((normal[ […]