ffmpeg des
extern "C"
{
#include <libavutil/des.h>
}
unsigned char key[] = "FDS5F46F5631DSV61DS11F1DAF16FDS5F46S1DFDS541F5631DSV61DS1F1DAF16"; int keylen = strlen((char*)key); unsigned char data[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; int datalen = strlen((char*)data); unsigned char buf_e[1024] = { 0 }; unsigned char buf_d[1024] = { 0 }; auto des = av_des_alloc(); auto ret = av_des_init(des, key, keylen, 0); av_des_crypt(des, buf_e,data,64,nullptr, 0); ret = av_des_init(des, key, keylen, 1); av_des_crypt(des, buf_d, buf_e, 64, nullptr, 1);