高手请进?关于加密解密的
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <crypt.h>
#include <unistd.h>
int main()
{
char key[65];
char str[1028];
char *s;
int i;
strcpy(str,"WJC1 DES!1223");
printf("before[%s]\n",str);
strcpy(key,"1234");
setkey(key);
s=str;
encrypt(s,0);//加密
printf("[%s]\n",s);
strcpy(key,"1234");
setkey(key);
encrypt(s,1);//解密,
printf("[%s]\n",s);
return 0;
}
cncrypt()是unix系统函数。
为何解密不出原数据呢?