#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <io.h>
//定义BSIZE为32*1M
#define BSIZE (32*1024*1024)
char buf[BSIZE];
int convertchar(char *buf, int bufsize);
int resumechar(char *buf, int bufsize);
int write_file(const char *fout, const char *buf, int bufsize);
int read_file(const char *fin, char *buf, int bufsize, int flag);
int p_buf(const char *buf, int n);
char *input_fname(char * in_fn, int fn_size);
void p_help(void);
int main(int argc, char *argv[])
{
char buf_sw[256], in_fn[256];
int read_n = 0;
p_help();
while(printf("\ninput cmd>"),gets(buf_sw))
{
switch(buf_sw[0])
{
case 'c':
printf("please input file(be converted) path...\n");
read_n = read_file(input_fname(in_fn, 256), buf, BSIZE, 0);
if(read_n < 0)
{
printf("read fail!\n");
break;
}
printf("begin convert file...\n");
//简单的 转换,加密文档
if(convertchar(buf, read_n))
{
printf("convert fail!\n");
break;
}

这篇博客分享了一个能够处理32M文本文件的自编明文加密程序的源代码,适用于文件保护和数据安全。通过CMD命令行操作,程序实现了输入文件的加密,并生成安全的输出文件。
最低0.47元/天 解锁文章
1499

被折叠的 条评论
为什么被折叠?



