/*设置本轮的左数据块*/
memcpy(lblk, rblk, 4);
/*设置本轮的右数据块*/
memcpy(rblk, xblk, 4);
}
/*将目标正文设置为重新连接的左右两个数据块*/
memcpy(&target[0], rblk, 4);
memcpy(&target[4], lblk, 4);
/*执行最终置换*/
permute(target, DesFinal, 64);
return 0;
}
/*des_encipher DES加密数据*/
void des_encipher(const unsigned char *plaintext, unsigned char *ciphertext, const unsigned char *key)
{
des_main(plaintext, ciphertext, key, encipher);
return;
}
/*des_decipher DES解密数据*/
void des_decipher(const unsigned char *ciphertext, unsigned char *plaintext, const unsigned char *key)
{
des_main(ciphertext, plaintext, key, decipher);
return;
}
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx