unsigned char input[] = "this is a text being encrypted by openssl";//需要加密的字符串 size_t len = (sizeof(input)+7)/8 * 8; unsigned char *output = new unsigned char[len+1]; //加密以后的内容怎么分配内存,照上面这两步走就是了 //错了就干掉贴代码的人:mrgreen: DES_cblock ivec; //照这个搞就是了,用别人的代码不一定要知道所由的细节是为什么