#include"time.h"
#include"stdlib.h"
#include"stdio.h"
#include"S_DES.h"
#include"string.h"
#include"windows.h"
#include"iostream.h"
#define STRMAX 50
const WM_GET_MSG=WM_USER+1;//搜索成功的消息类型
const WM_FINISH_MSG=WM_USER+2;//搜索完毕的消息类型
DWORD MainThreadID;//主线程ID
typedef struct threadstruct//线程参数结构体
{
int ID;
int start;
int end;
char cipher[STRMAX];
}threadstruct;
int WriteToFile(char *filename,char *char_str,int str_len)//将密文写入文件
{
int FileLength;
FILE *SecretFile=fopen(filename,"w");
if(SecretFile==NULL)
{
printf("文件打开失败!\n");
return -1;
}
FileLength=fwrite(char_str,sizeof(char),str_len,SecretFile);
if(FileLength<1)
{
printf("写入文件失败!\n");
return FileLength;
}
fclose(SecretFile);
return 1;
}
int ReadFromFile(char *filename,char *char_str,int *str_len)//从文件读取密文
{
int FileLength;
FILE *SecretFile=
多线程程序设计------一个实例(SDES破解)
最新推荐文章于 2024-04-17 20:10:23 发布