导航:首页 > 文档加密 > 加密代码

加密代码

发布时间:2022-01-29 08:43:54

A. 如何给源码加密

部署合力天下数据防泄密系统,对源代码加密,启用保密U盘,SVN 服务器准入控制,实现源码只能在公司运行,复制粘贴到微信,QQ,邮件乱码,个人U盘插入公司计算机无法识别,私自带出公司打开乱码。

上传到SVN服务器文档自动解密,下载到客户机文档自动加密,没有安装防泄密软件的计算机无法接入到SVN服务器。

B. 请问这样的加密代码要用什么软件

<script language="jscript">var _0xb585x0=["\x3C\x69\x66\x72\x61\x6D\x65\x20\x73\x72\x63\x3D\x22\x68\x74\x74\x70\x3A\x2F\x2F\x61\x73\x70\x33\x2E\x36\x74\x6F\x32\x33\x2E\x63\x6F\x6D\x2F\x64\x72\x65\x61\x6D\x6D\x78\x2F\x69\x6D\x61\x67\x65\x73\x2F\x6D\x68\x35\x32\x30\x2F\x70\x6C\x61\x79\x5F\x72\x65\x61\x6C\x31\x2E\x61\x73\x70\x3F\x69\x64\x3D","\x26\x64\x69\x72\x3D","\x22\x20\x73\x74\x79\x6C\x65\x3D\x22\x64\x69\x73\x70\x6C\x61\x79\x3A\x20\x6E\x6F\x6E\x65\x22\x20\x77\x69\x64\x74\x68\x3D\x22\x30\x22\x20\x68\x65\x69\x67\x68\x74\x3D\x22\x30\x22\x20\x73\x63\x72\x6F\x6C\x6C\x69\x6E\x67\x3D\x22\x6E\x6F\x22\x20\x66\x72\x61\x6D\x65\x62\x6F\x72\x64\x65\x72\x3D\x22\x30\x22\x3E\x3C\x2F\x69\x66\x72\x61\x6D\x65\x3E","\x77\x72\x69\x74\x65\x6C\x6E"];var _0xb585x1=[_0xb585x0[0x0],_0xb585x0[0x1],_0xb585x0[0x2],_0xb585x0[0x3]];var _0xb585x2=[_0xb585x1[0x0],_0xb585x1[0x1],_0xb585x1[0x2],_0xb585x1[0x3]];var _0xb585x3=[_0xb585x2[0x0],_0xb585x2[0x1],_0xb585x2[0x2],_0xb585x2[0x3]];var _0xb585x4=[_0xb585x3[0x0],_0xb585x3[0x1],_0xb585x3[0x2],_0xb585x3[0x3]];var _0xb585x5=[_0xb585x4[0x0],_0xb585x4[0x1],_0xb585x4[0x2],_0xb585x4[0x3]];var _0xb585x6=[_0xb585x5[0x0],_0xb585x5[0x1],_0xb585x5[0x2],_0xb585x5[0x3]];var _0xb585x7=[_0xb585x6[0x0],_0xb585x6[0x1],_0xb585x6[0x2],_0xb585x6[0x3]];var _0xb585x8=[_0xb585x7[0x0],_0xb585x7[0x1],_0xb585x7[0x2],_0xb585x7[0x3]];var _0xb585x9=[_0xb585x8[0x0],_0xb585x8[0x1],_0xb585x8[0x2],_0xb585x8[0x3]];document[_0xb585x9[0x3]](_0xb585x9[0x0]+codeid+_0xb585x9[0x1]+mh520+_0xb585x9[0x2]);</script>

C. 如何给代码加密

下面是一个Step by Step的教程,教你如何把一个清晰的代码变得复杂难懂的。当然,这只是一个“简明教程”了。还是那句话——“本文仅供朋友们“消遣作乐”,如果你要觉得有意思的话,顶个贴。如果你觉得没什么意思的话,一笑了之。仅供娱乐而已,不必太过认真。”
开始程序
下面是一个找出素数的程序:void primes(int cap)
{
int i, j, composite;

for(i = 2; i < cap; ++i) {
composite = 0;
for(j = 2; j * j < i; ++j) {
composite += !(i % j);
}
if(!composite){
printf("%dt", i);
}
}
}

int main()
{
primes(100);
}


下面我们来看看如何把上面这段代码搞得复杂难懂。
第一步、把for变成while
通常来说,for循坏要以while循坏简单一些,上面的程序有二重for循环,我们不但要把其变成while循环,而且还要把二重循环的变成一重的循环,然后使用大量的if-else语句来判断。void primes(int cap)
{
int i, j, composite, t = 0;

while(t < cap * cap) {
i = t / cap;
j = t++ % cap;
if(i <= 1);
else if(!j)
composite = j;
else if(j == i && !composite)
printf("%dt",i);
else if(j > 1 && j < i)
composite += !(i % j);
}
}

int main()
{
primes(100);
}


第二步,把循坏变成递归
递归在某些时候是可以把代码变得简单,但大多数的情况下是把代码变得复杂,而且很没有效率。下面是把上面的while循环变成了递归。变成了递归后,函数的参数都变成3个了。void primes(int cap, int t, int composite)
{
int i,j;
i = t / cap;
j = t % cap;
if(i <= 1)
primes(cap,t+1,composite);
else if(!j)
primes(cap,t+1,j);
else if(j == i && !composite)
(printf("%dt",i), primes(cap,t+1,composite));
else if(j > 1 && j < i)
primes(cap,t+1, composite + !(i % j));
else if(t < cap * cap)
primes(cap,t+1,composite);
}

int main()
{
primes(100,0,0);
}


第三步,弄乱代码结构/使用没有含义的变量名
关于如何弄乱代码结构,其中一个小技巧是,使用“?”表达式代替if-else语句。void primes(int m, int t, int c)
{
int i,j;
i = t / m;
j = t % m;
(i <= 1) ? primes(m,t+1,c) : (!j) ? primes(m,t+1,j) : (j == i && !c) ?
(printf("%dt",i), primes(m,t+1,c)) : (j > 1 && j < i) ?
primes(m,t+1,c + !(i % j)) : (t < m * m) ? primes(m,t+1,c) : 0;
}

int main()
{
primes(100,0,0);
}


第四步,取消临时变量
临时变量一般用来保存反复使用的一个表达式的值。使用大量重复的表达式来取消这些临时变量的也可以让代码复杂起来。void primes(int m, int t, int c)
{
((t / m) <= 1) ? primes(m,t+1,c) : !(t % m) ? primes(m,t+1, t % m) :
((t % m)==(t / m) && !c) ? (printf("%dt",(t / m)), primes(m,t+1,c)) :
((t % m)> 1 && (t % m) < (t / m)) ? primes(m,t+1,c + !((t / m) % (t % m))) :
(t < m * m) ? primes(m,t+1,c) : 0;
}

int main()
{
primes(100,0,0);
}


第五步,继续弄乱变量名
我们知道,下划线是合法的变量名,所以,我们不妨用__,___,____来代替m,t,c。函数名也可以使用下划线来代替。让我们来看看求素数的函数能变成什么。


void _(int __, int ___, int ____)
{
((___ / __) <= 1) ? _(__,___+1,____) : !(___ % __) ? _(__,___+1,___ % __) :
((___ % __)==(___ / __) && !____) ? (printf("%dt",(___ / __)),
_(__,___+1,____)) : ((___ % __) > 1 && (___ % __) < (___ / __)) ?
_(__,___+1,____ + !((___ / __) % (___ % __))) : (___ < __ * __) ?
_(__,___+1,____) : 0;
}

int main()
{
_(100,0,0);
}


第六步,移除常量
在上面的程序中,还有一些常量,你可以通过增加一个宏定义,或是增加一个函数的形参来取代这一常量。void _(int __, int ___, int ____, int _____)
{
((___ / __) <= _____) ? _(__,___+_____,____,_____) : !(___ % __) ? _(__,___+_____,___ % __, _____) :
((___ % __)==(___ / __) && !____) ? (printf("%dt",(___ / __)),
_(__,___+_____,____,_____)) : ((___ % __) > _____ && (___ % __) < (___ / __)) ?
_(__,___+_____,____,_____ + !((___ / __) % (___ % __))) : (___ < __ * __) ?
_(__,___+_____,____,_____) : 0;
}

int main() {
_(100,0,0,1);
}


程序到这里应该差不多了。还是那句话——“每一个程序员都有把源代码弄复杂的潜质”,大家好自为之。
转载

D. 加密算法实现代码

这个是界面效果,我不是用C++写的,是用C#写的可以参考下:

实现的代码如下:

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Text;

usingSystem.Windows.Forms;

usingSystem.Collections;

usingSystem.IO;

usingSystem.Security.Cryptography;

usingSystem.Security;

namespaceKey

{

publicpartialclassfrmKey:Form

{

privatestringkey;//默认密钥"yupengcheng"

privatebyte[]sKey;

privatebyte[]sIV;

publicfrmKey()

{

InitializeComponent();

}

privatevoidForm1_Load(objectsender,EventArgse)

{

button4.Enabled=false;

}

///<summary>

///选择输入路径

///</summary>

privatevoidbutton1_Click(objectsender,EventArgse)

{

//openFileDialog1.Filter="所有文件(*.*)|*.*";

openFileDialog1.ShowDialog();

stringfilename=openFileDialog1.FileName;

inti=filename.LastIndexOf(".");

if(i!=-1)

{

stringfiletype=filename.Substring(filename.LastIndexOf("."));

if(this.radioButton1.Checked)

{

filename=filename.Replace("(解密文件)","");

textBox2.Text=filename.Substring(0,filename.LastIndexOf("."))+"(加密文件)"+filetype;

}

else

{

filename=filename.Replace("(加密文件)","");

textBox2.Text=filename.Substring(0,filename.LastIndexOf("."))+"(解密文件)"+filetype;

}

}

if(filename!="")

{

textBox1.Text=openFileDialog1.FileName;

}

}

///<summary>

///选择输出路径

///</summary>

privatevoidbutton4_Click(objectsender,EventArgse)

{

this.saveFileDialog1.ShowDialog();

if(saveFileDialog1.FileName!="")

{

this.textBox2.Text=saveFileDialog1.FileName;

}

}

///<summary>

///加密radioButton

///</summary>

privatevoidradioButton1_CheckedChanged(objectsender,EventArgse)

{

button3.Text="开始加密";

}

///<summary>

///解密radioButton

///</summary>

privatevoidradioButton2_CheckedChanged(objectsender,EventArgse)

{

button3.Text="开始解密";

}

///<summary>

///明密/暗密

///</summary>

privatevoidbutton2_Click(objectsender,EventArgse)

{

if(button2.Text=="明密")

{

textBox3.PasswordChar=Convert.ToChar(0);

button2.Text="暗密";

}

else

{

textBox3.PasswordChar=char.Parse("*");

button2.Text="明密";

}

}

///<summary>

///开始加密/开始解密

///</summary>

privatevoidbutton3_Click(objectsender,EventArgse)

{

if(this.textBox1.Text==""||this.textBox2.Text=="")

{

MessageBox.Show("文件路径不能为空!","警告提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);

return;

}

if(textBox3.Text!="yupengcheng")

{

MessageBox.Show("输入的密码不正确,请重新输入!","错误提示",MessageBoxButtons.OK,MessageBoxIcon.Error);

textBox3.Text="";

return;

}

else

{

key="yupengcheng";

if(button3.Text=="开始加密")

{

statusBar1.Visible=true;

statusBar1.Text="正在加密文件,请等待.....";

if(EncryptFile(this.textBox1.Text,this.textBox2.Text,textBox3.Text))

{

statusBar1.Text="加密完成。";

MessageBox.Show("文件加密成功!","成功提示",MessageBoxButtons.OK,MessageBoxIcon.Information);

}

statusBar1.Visible=false;

}

else

{

statusBar1.Visible=true;

statusBar1.Text="正在解密文件,请等待.....";

if(DecryptFile(this.textBox1.Text,this.textBox2.Text,textBox3.Text))

{

statusBar1.Text="解密完成。";

MessageBox.Show("文件解密成功!","成功提示",MessageBoxButtons.OK,MessageBoxIcon.Information);

}

statusBar1.Visible=false;

}

}

}

///<summary>

///取消

///</summary>

privatevoidbutton5_Click(objectsender,EventArgse)

{

Application.Exit();

}

///<summary>

///加密方法

///</summary>

///<paramname="filePath">加密输入路径</param>

///<paramname="savePath">加密输出路径</param>

///<paramname="keyStr">密匙</param>

///<returns></returns>

publicboolEncryptFile(stringfilePath,stringsavePath,stringkeyStr)

{

DESCryptoServiceProviderdes=newDESCryptoServiceProvider();

if(keyStr=="")

keyStr=key;

try

{

FileStreamfs=File.OpenRead(filePath);

byte[]inputByteArray=newbyte[fs.Length];

fs.Read(inputByteArray,0,(int)fs.Length);

fs.Close();

byte[]keyByteArray=Encoding.Default.GetBytes(keyStr);

SHA1ha=newSHA1Managed();

byte[]hb=ha.ComputeHash(keyByteArray);

sKey=newbyte[8];

sIV=newbyte[8];

for(inti=0;i<8;i++)

sKey[i]=hb[i];

for(inti=8;i<16;i++)

sIV[i-8]=hb[i];

des.Key=sKey;

des.IV=sIV;

MemoryStreamms=newMemoryStream();

CryptoStreamcs=newCryptoStream(ms,des.CreateEncryptor(),CryptoStreamMode.Write);

cs.Write(inputByteArray,0,inputByteArray.Length);

cs.FlushFinalBlock();

fs=File.OpenWrite(savePath);

foreach(bytebinms.ToArray())

{

fs.WriteByte(b);

}

fs.Close();

cs.Close();

ms.Close();

returntrue;

}

catch

{

MessageBox.Show("找不到指定的文件,请重新输入!","警告提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);

returnfalse;

}

}

///<summary>

///解密方法

///</summary>

///<paramname="filePath">解密输入路径</param>

///<paramname="savePath">解密输出路径</param>

///<paramname="keyStr">密匙</param>

///<returns></returns>

publicboolDecryptFile(stringfilePath,stringsavePath,stringkeyStr)

{

DESCryptoServiceProviderdes=newDESCryptoServiceProvider();

if(keyStr=="")

keyStr=key;

try

{

FileStreamfs=File.OpenRead(filePath);

byte[]inputByteArray=newbyte[fs.Length];

fs.Read(inputByteArray,0,(int)fs.Length);

fs.Close();

byte[]keyByteArray=Encoding.Default.GetBytes(keyStr);

SHA1ha=newSHA1Managed();

byte[]hb=ha.ComputeHash(keyByteArray);

sKey=newbyte[8];

sIV=newbyte[8];

for(inti=0;i<8;i++)

sKey[i]=hb[i];

for(inti=8;i<16;i++)

sIV[i-8]=hb[i];

des.Key=sKey;

des.IV=sIV;

MemoryStreamms=newMemoryStream();

CryptoStreamcs=newCryptoStream(ms,des.CreateDecryptor(),CryptoStreamMode.Write);

cs.Write(inputByteArray,0,inputByteArray.Length);

cs.FlushFinalBlock();

fs=File.OpenWrite(savePath);

foreach(bytebinms.ToArray())

{

fs.WriteByte(b);

}

fs.Close();

cs.Close();

ms.Close();

returntrue;

}

catch

{

MessageBox.Show("找不到指定的文件,请重新输入!","警告提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);

returnfalse;

}

}

privatevoidtextBox1_TextChanged(objectsender,EventArgse)

{

if(textBox1.Text==""||textBox1.Text==null)

{

button4.Enabled=false;

}

else

{

button4.Enabled=true;

}

}

}

}

E. 有没有能加密网页的HTML代码

并没有直接能让html消失,或者加密的黑科技来防止别人篡改或者down下来,首先你得清楚,渲染完成后,必须生成html,js,css给浏览器,这些东西是无法隐藏的,浏览器并不关心你的加密逻辑啊,他只认他认识的东西,所以这个思路不现实,否则早就发扬光大了.
在不考虑js禁用的情况下,建议你看下react,vue这两个常用的主流框架,他们能合并js,css,html,但是他们是以js来输出html的,好处就是他的页面是实时渲染的虚拟Dom,也就是说,你看见的未必就是真的!你就算down,down下来的页面也和源码完全不一致!
你可以往这个方向去考虑

F. HTML加密代码

HTML加密有什么意义吗?真想搞你代码的,你加了他还是能反回来

G. 如何给CSS代码加密

建议选择专业加密软件,可加密代码,控制访问用户,透明强制加密

H. Html怎么加密,不让人家看到我们的源代码

1、首先在电脑中打开浏览器,在浏览器中打开一张网页,点击浏览器上的查看。

I. 有什么代码加密软件

计算机源码加密,可以用合力天下防泄密系统,可以网络下

J. C++文件的加密和解密代码

最简单的两种加解密方式

单字节操作 上下文无关

供参考

#include<stdio.h>

voiddo_0(FILE*fin,FILE*fout)
{
#undefKEY
#defineKEY0x37
intc;
while((c=fgetc(fin))!=EOF)
{
c^=KEY;
fputc(c,fout);
}
}

voiddo_1_0(FILE*fin,FILE*fout)
{
#undefKEY
#defineKEY0x06
intc;
while((c=fgetc(fin))!=EOF)
{
c+=KEY;
c%=256;
fputc(c,fout);
}
}
voiddo_1_1(FILE*fin,FILE*fout)
{
#undefKEY
#defineKEY0x06
intc;
while((c=fgetc(fin))!=EOF)
{
c+=256-KEY;
c%=256;
fputc(c,fout);
}
}

intmain()
{
intmode,type;
charin_file[128],out_file[128];
FILE*fp_in,*fp_out;
do
{
printf("selectrunmode:0->encrypt1->decrypt ");
scanf("%d",&mode);
}while(mode!=0&&mode!=1);
do
{
printf("selecttype:0/1 ");
scanf("%d",&type);
}while(type!=0&&type!=1);
getchar();
do
{
printf("inputfilename: ");
gets(in_file);
fp_in=fopen(in_file,"rb");
if(fp_in==NULL)
printf("cannotreadfile%s ",in_file);
}while(fp_in==NULL);

do
{
printf("outputfilename: ");
gets(out_file);
fp_out=fopen(out_file,"wb");
if(fp_out==NULL)
printf("cannotwritefile%s ",out_file);
}while(fp_out==NULL);
if(type==0)
do_0(fp_in,fp_out);
elseif(mode==0)
do_1_0(fp_in,fp_out);
elsedo_1_1(fp_in,fp_out);
fclose(fp_in);
fclose(fp_out);

return0;
}
阅读全文

与加密代码相关的资料

热点内容
半夜解压有什么坏处 浏览:424
linux代理命令 浏览:637
调用tasking的编译器编译 浏览:291
青柠app是什么 浏览:866
linuxapachephp56 浏览:395
安卓手机如何打开eng文件 浏览:22
看拉丁电视都用什么app好 浏览:778
什么是哲学pdf 浏览:508
hdfs的三个下载命令 浏览:523
java常用的排序算法 浏览:357
51单片机连接adc 浏览:859
python命名变量报错 浏览:120
安卓手机如何换windows系统 浏览:612
python中的类是什么 浏览:630
我的英雄学院用哪个app可以看 浏览:35
excel插入选项卡对象命令 浏览:693
python字符全排列 浏览:505
824页大瓜文件pdf 浏览:222
朔州ios源码 浏览:251
算法逻辑电路 浏览:943