C软件加密,C语言软件加密,很多人理解为对C语言软件的文件设定打开需要输入密码,其实严格意义上来讲,这个不叫加密,仅可以理解为设定密码进行保护。加密软件来给C软件文件加密呢,是指对这些C语言的代码进行加密处理,使这些语言能在安装有加密软件客户端的电脑上正常使用,而没有安装加密软件的电脑,拿到了这些被加密过的C语言也无法正常打开并使用,从而达到保护C软件开发者的研发成果,著作专利的目的。
有网友编写了一段需要通过输入密码才能打开C语言文件的代码,其操作是指示用户键入一个完整的文件名,包含文件路径和文件名,如后输入加密密码,就可以对指定文件进行加密了。
加密的原理:读出文件中的字符,然后与自己输入的加密密码进行异或,然后写到新的文件中。解密过程与加密原理一样。
程序编写如下:
#include <stdio.h>
#pragma hdrstop
#include <tchar.h>
#pragma argsused
int _tmain(int argc, _TCHAR* argv[])
{
FILE *file1,*file2;
int i;
int paslen;
char ch;
char source[30],destin[30],password[10];
printf("Please input the source file(less than 30 charcters):\n");
gets(source);
printf("please input the destination file(less than 30 charcters):\n");
gets(destin);
printf("please input the password(less than 10 ditigals):\n");
gets(password);
paslen=strlen(password);//获取密码长度
if((file1=fopen(source,"rb"))!=NULL)
{
printf("the source file %s opened successfully.\n",source);
if((file2=fopen(destin,"wb+"))!=NULL)
{
printf("the destination file %s created successfully\n",destin);
ch=fgetc(file1);
i=0;
while(ch!=EOF)
{
ch=ch^(password[i++]); //利用密码进行加密
if(i>=paslen)
i=0;
fputc(ch,file2);
ch=fgetc(file1);
}
fclose(file1);
fclose(file2);
}
else
{
printf("the destination file %s created error\n",destin);
}
}
else
{
printf("the source file %s opened error.\n",source);
}
getchar();
return 0;
}
就是这样一个简单的程序,就可以实现对某文化路径下的文件进行录入密码进行保护的目的了。


依法履行网络安全保护义务、制定内部管理制度和安全规范、对网络采取防范计算机病毒和网络攻击等安全技术措施要加强、按法律规定留存不少于六个月的网络日志。
企业加密软件厂商加密水印功能优劣势探讨,不同加密软件厂商的水印功能不同,水印功能对员工工作和企业防泄密的效果也各不相同,本文探讨不同水印的优劣势特点。