那个兄弟又c语言下的文件加密代码?同事要我帮忙写个,我没写过,也没时间,所以向大家求教。贴出源代码验证后给100分以上。(内空)

hammer_shi 2002-05-16 05:34:02
rt~~~~~

最好贴在这上面。

fzdxsj@163.net.
...全文
111 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
hammer_shi 2002-06-02
  • 打赏
  • 举报
回复
TO: leopro(六月飞雪)
对不起,前些日子没时间关注这个,实在不好意思。
刚才想试验一下,那知道编译器坏了。哦,给你50分怎么样?算是谢的。
zhai19800722 2002-05-20
  • 打赏
  • 举报
回复
真厉害!
laizi 2002-05-19
  • 打赏
  • 举报
回复
给我一个mail吧,我给你穿一个ok?
leopro 2002-05-19
  • 打赏
  • 举报
回复
KAO!
顶楼的连个谢字都舍不得说?
richgod 2002-05-17
  • 打赏
  • 举报
回复
我也急着用,请教。
askrxw@sina.com
leopro 2002-05-17
  • 打赏
  • 举报
回复
N年以前的,异或加密,c语言
不知能不能满足要求
感兴趣的话移植到vc,加上一个GUI就行了

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>

void main(int argc,char *argv[])
{
FILE *fp1,*fp2;
unsigned char c,ch;
char key[20];
char name[20];
if (argc==1)
{
system("cls");
printf("\nVersion 1.0 JM.EXE (c) by leopro\n");
printf("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf(" This is a free program. It can encipher your files.\n");
printf("This single file can do encryption and decryption.\n\n");
printf("Command line: JM [oldfile] [newfile]\n");
printf(" OR JM [filename]\n\n");
printf(" Then you will be asked to input a password, choose a password include numbers\n");
printf("and characters. Remember the password, without it you can't open your file!\n\n\n");
printf("Press 'Q' or 'q' to quit, others to go on!\n");
ch=getch();
if((ch=='Q')||(ch=='q')) exit(0);
else
printf("Please input the filename to process: ");
scanf("%s",name);
fp1=fopen(name,"rb");
strcat(name,".jm");
fp2=fopen(name,"wb");
}
else
{
fp1=fopen(argv[1],"rb");
if (argc==2) fp2=fopen(argv[1],"wb");
if (argc==3) fp2=fopen(argv[2],"wb");
}
if (fp1==NULL || fp2==NULL)
{ printf("Cannot open file!\n");
exit(1); }
printf("Please input the key:");
scanf("%s",key);
srand((unsigned int)key);
ch=fgetc(fp1);
while (!feof(fp1)) {
c=rand();
ch=ch^c;
fputc(ch,fp2);
ch=fgetc(fp1);
}
fclose(fp1);
fclose(fp2);
exit(0);
}

33,010

社区成员

发帖
与我相关
我的任务
社区描述
数据结构与算法相关内容讨论专区
社区管理员
  • 数据结构与算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧