‘壹’ 如何给.Net软件加密
可以使用加密狗进行加密,把软件的一部分信息写入加密狗里进行绑定,使加密狗成为软件的一部分,没有加密狗无法运行。也可以使用外壳加密,不需要二次开发。可以试试ROCKEY系列的加密狗。
‘贰’ .net软件,用什么软件加密狗加密,能防止代码反编译
.Net软件的特点,一些强大的编译工具可以对.Net可执行文件进行反编译操作,并得出相应的IL代码甚至是源代码。即使是采用混淆工具以及强命名工具也不能从根本上解决问题,代码依然会很容易地被Reflectoer等工具反编译源代码。
软件加密狗:威步(WIBU)的CodeMeter,AxProtector(for.net)两款软件加密狗性能非常不错
反编译的问题,与传统的代码混淆工具(Obfuscator)不同,AxProtector可以完全阻止对.NET
程序集(由
C#,
VB.NET,
Delphi.NET,
ASP.Net…
等语言编写)的反编译。通俗的讲,AxProtector在破解者和您的
.NET
代码之间构建了强大的防破解保护屏障,生成一个基于
Windows
的而不是基于
MSIL
的兼容格式文件。原始的
.NET
代码完整的被加密后封装在本地代码内,无论何时都不会释放到硬盘,对于破解者是不可见的。
与单纯的.net加密软件不同,AxProtector与CodeMeter硬件加密狗配套餐使用,采用了更为严密的密钥管理,及最先进的AES、RSA、ECC等加密算法存储或传输密钥,保证通讯安全。
.Net代码编译后生成的
.class
中包含有源代码中的所有信息(不包括注释),尤其是在其中保存有调试信息的时候。所以一个按照正常方式编译的.class
文件可以非常轻易地被反编译。一般软件开发商会采用一种叫做混淆器的工具。混淆器的作用是对编译好的代码进行混淆,使得其无法被反编译或者反编译后的代码混乱难懂。由于混淆器只是混淆了方法名称或流程,而不能防止源代码被反编译,因此混淆器的作用只是增加了反编译的难度,最终的结果也是治标不治本。对于一些掌握工具的人来说几乎还是透明的。AxProtector是一款真正意义的加密源代码、防止反编译的.net软件加密软件。
AxProtector加密了.net原代码,任何时候原代码都不可能被还原到硬盘当中。采用AxProtector加密后的.net代码只有在程序调用或执行某一段函数的时候,才能通过AxProtectorClass在内存中解密后返回到程序中执行,运行之后迅速立即加密。这种随机加密、按需解密原代码的功能,能很好的防止.Net程序的反编译,同时能够很好地防止API加密点被摘除。有效地保证了源代码的执行效率和安全性。
‘叁’ .NET如何实现数据加密
http://www.microsoft.com/china/technet/security/guidance/secmod39.mspx(最好的理论资料)
建立一个win form程序,然后把代码拷到后台,即可实现C#非对称加密程序 。 
using System; 
using System.Drawing; 
using System.Collections; 
using System.ComponentModel; 
using System.Windows.Forms; 
using System.Data; 
using System.IO; 
using System.Text; 
using System.Security.Cryptography; 
namespace 非对称加密 
{ 
/// <summary> 
/// Form1 的摘要说明。 
/// </summary> 
public class Form1 : System.Windows.Forms.Form 
{ 
private System.Windows.Forms.TabControl tabControl1; 
private System.Windows.Forms.TabPage tabPage1; 
private System.Windows.Forms.TabPage tabPage2; 
private System.Windows.Forms.Button button1; 
private System.Windows.Forms.Button button2; 
private System.Windows.Forms.Button button3; 
private System.Windows.Forms.SaveFileDialog save; 
private System.Windows.Forms.Label label1; 
private System.Windows.Forms.TextBox textBox1; 
private System.Windows.Forms.Button button4; 
private System.Windows.Forms.Button button5; 
private System.Windows.Forms.Label label2; 
private System.Windows.Forms.RichTextBox richtext2; 
private System.Windows.Forms.OpenFileDialog open; 
private System.Windows.Forms.Label label3; 
private System.Windows.Forms.RichTextBox richtext3; 
private System.Windows.Forms.RichTextBox richtext; 
private System.Windows.Forms.Button button6; 
private System.Windows.Forms.Button button7; 
private System.Windows.Forms.Button button8; 
/// <summary> 
/// 必需的设计器变量。 
private static RSACryptoServiceProvider crypt; 
private static string privatekey; 
private static string publickey; 
private static byte [] bytes; 
private static string publicinfo; 
private static string privateinfo; 
private static string readpublickey; 
private static string readprivatekey; 
// ///private static byte [] onebytes ; 
/// </summary> 
private System.ComponentModel.Container components = null; 
public Form1() 
{ 
// 
// Windows 窗体设计器支持所必需的 
// 
InitializeComponent(); 
// 
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码 
// 
} 
/// <summary> 
/// 清理所有正在使用的资源。 
/// </summary> 
protected override void Dispose( bool disposing ) 
{ 
if( disposing ) 
{ 
if (components != null) 
{ 
components.Dispose(); 
} 
} 
base.Dispose( disposing ); 
} 
#region Windows 窗体设计器生成的代码 
/// <summary> 
/// 设计器支持所需的方法 - 不要使用代码编辑器修改 
/// 此方法的内容。 
/// </summary> 
private void InitializeComponent() 
{ 
this.tabControl1 = new System.Windows.Forms.TabControl(); 
this.tabPage1 = new System.Windows.Forms.TabPage(); 
this.button6 = new System.Windows.Forms.Button(); 
this.button3 = new System.Windows.Forms.Button(); 
this.button2 = new System.Windows.Forms.Button(); 
this.richtext = new System.Windows.Forms.RichTextBox(); 
this.button1 = new System.Windows.Forms.Button(); 
this.tabPage2 = new System.Windows.Forms.TabPage(); 
this.button8 = new System.Windows.Forms.Button(); 
this.button7 = new System.Windows.Forms.Button(); 
this.label3 = new System.Windows.Forms.Label(); 
this.richtext3 = new System.Windows.Forms.RichTextBox(); 
this.label2 = new System.Windows.Forms.Label(); 
this.richtext2 = new System.Windows.Forms.RichTextBox(); 
this.button5 = new System.Windows.Forms.Button(); 
this.button4 = new System.Windows.Forms.Button(); 
this.textBox1 = new System.Windows.Forms.TextBox(); 
this.label1 = new System.Windows.Forms.Label(); 
this.save = new System.Windows.Forms.SaveFileDialog(); 
this.open = new System.Windows.Forms.OpenFileDialog(); 
this.tabControl1.SuspendLayout(); 
this.tabPage1.SuspendLayout(); 
this.tabPage2.SuspendLayout(); 
this.SuspendLayout(); 
// 
// tabControl1 
// 
this.tabControl1.Controls.Add(this.tabPage1); 
this.tabControl1.Controls.Add(this.tabPage2); 
this.tabControl1.Location = new System.Drawing.Point(32, 64); 
this.tabControl1.Name = "tabControl1"; 
this.tabControl1.SelectedIndex = 0; 
this.tabControl1.Size = new System.Drawing.Size(416, 280); 
this.tabControl1.TabIndex = 0; 
// 
// tabPage1 
// 
this.tabPage1.Controls.Add(this.button6); 
this.tabPage1.Controls.Add(this.button3); 
this.tabPage1.Controls.Add(this.button2); 
this.tabPage1.Controls.Add(this.richtext); 
this.tabPage1.Controls.Add(this.button1); 
this.tabPage1.Location = new System.Drawing.Point(4, 21); 
this.tabPage1.Name = "tabPage1"; 
this.tabPage1.Size = new System.Drawing.Size(408, 255); 
this.tabPage1.TabIndex = 0; 
this.tabPage1.Text = "得到钥匙"; 
// 
// button6 
// 
this.button6.Location = new System.Drawing.Point(72, 168); 
this.button6.Name = "button6"; 
this.button6.TabIndex = 4; 
this.button6.Text = "写入文件"; 
this.button6.Click += new System.EventHandler(this.button6_Click); 
// 
// button3 
// 
this.button3.Location = new System.Drawing.Point(200, 16); 
this.button3.Name = "button3"; 
this.button3.TabIndex = 3; 
this.button3.Text = "保存私匙"; 
this.button3.Click += new System.EventHandler(this.button3_Click); 
// 
// button2 
// 
this.button2.Location = new System.Drawing.Point(128, 16); 
this.button2.Name = "button2"; 
this.button2.TabIndex = 2; 
this.button2.Text = "保存公钥"; 
this.button2.Click += new System.EventHandler(this.button2_Click); 
// 
// richtext 
// 
this.richtext.Location = new System.Drawing.Point(16, 56); 
this.richtext.Name = "richtext"; 
this.richtext.Size = new System.Drawing.Size(256, 96); 
this.richtext.TabIndex = 1; 
this.richtext.Text = "richTextBox1"; 
// 
// button1 
// 
this.button1.Location = new System.Drawing.Point(8, 16); 
this.button1.Name = "button1"; 
this.button1.Size = new System.Drawing.Size(88, 23); 
this.button1.TabIndex = 0; 
this.button1.Text = "得到钥匙信息"; 
this.button1.Click += new System.EventHandler(this.button1_Click); 
// 
// tabPage2 
// 
this.tabPage2.Controls.Add(this.button8); 
this.tabPage2.Controls.Add(this.button7); 
this.tabPage2.Controls.Add(this.label3); 
this.tabPage2.Controls.Add(this.richtext3); 
this.tabPage2.Controls.Add(this.label2); 
this.tabPage2.Controls.Add(this.richtext2); 
this.tabPage2.Controls.Add(this.button5); 
this.tabPage2.Controls.Add(this.button4); 
this.tabPage2.Controls.Add(this.textBox1); 
this.tabPage2.Controls.Add(this.label1); 
this.tabPage2.Location = new System.Drawing.Point(4, 21); 
this.tabPage2.Name = "tabPage2"; 
this.tabPage2.Size = new System.Drawing.Size(408, 255); 
this.tabPage2.TabIndex = 1; 
this.tabPage2.Text = "加密解密文字"; 
// 
// button8 
// 
this.button8.Location = new System.Drawing.Point(216, 72); 
this.button8.Name = "button8"; 
this.button8.TabIndex = 9; 
this.button8.Text = "读取私匙"; 
this.button8.Click += new System.EventHandler(this.button8_Click); 
// 
// button7 
// 
this.button7.Location = new System.Drawing.Point(56, 72); 
this.button7.Name = "button7"; 
this.button7.TabIndex = 8; 
this.button7.Text = "读取公匙"; 
this.button7.Click += new System.EventHandler(this.button7_Click); 
// 
// label3 
// 
this.label3.Location = new System.Drawing.Point(200, 120); 
this.label3.Name = "label3"; 
this.label3.Size = new System.Drawing.Size(100, 16); 
this.label3.TabIndex = 7; 
this.label3.Text = "解密结果"; 
// 
// richtext3 
// 
this.richtext3.Location = new System.Drawing.Point(200, 144); 
this.richtext3.Name = "richtext3"; 
this.richtext3.Size = new System.Drawing.Size(120, 72); 
this.richtext3.TabIndex = 6; 
this.richtext3.Text = "richTextBox2"; 
// 
// label2 
// 
this.label2.Location = new System.Drawing.Point(48, 120); 
this.label2.Name = "label2"; 
this.label2.Size = new System.Drawing.Size(128, 16); 
this.label2.TabIndex = 5; 
this.label2.Text = "加密窗口:"; 
// 
// richtext2 
// 
this.richtext2.Location = new System.Drawing.Point(40, 144); 
this.richtext2.Name = "richtext2"; 
this.richtext2.Size = new System.Drawing.Size(120, 72); 
this.richtext2.TabIndex = 4; 
this.richtext2.Text = "richTextBox2"; 
// 
// button5 
// 
this.button5.Location = new System.Drawing.Point(200, 96); 
this.button5.Name = "button5"; 
this.button5.Size = new System.Drawing.Size(112, 23); 
this.button5.TabIndex = 3; 
this.button5.Text = "使用私匙解密"; 
this.button5.Click += new System.EventHandler(this.button5_Click); 
// 
// button4 
// 
this.button4.Location = new System.Drawing.Point(48, 96); 
this.button4.Name = "button4"; 
this.button4.Size = new System.Drawing.Size(96, 23); 
this.button4.TabIndex = 2; 
this.button4.Text = "使用公匙加密"; 
this.button4.Click += new System.EventHandler(this.button4_Click); 
// 
// textBox1 
// 
this.textBox1.Location = new System.Drawing.Point(104, 32); 
this.textBox1.Multiline = true; 
this.textBox1.Name = "textBox1"; 
this.textBox1.Size = new System.Drawing.Size(168, 32); 
this.textBox1.TabIndex = 1; 
this.textBox1.Text = "textBox1"; 
// 
// label1 
// 
this.label1.Location = new System.Drawing.Point(128, 8); 
this.label1.Name = "label1"; 
this.label1.Size = new System.Drawing.Size(120, 16); 
this.label1.TabIndex = 0; 
this.label1.Text = "请输入加密的文字"; 
// 
// Form1 
// 
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); 
this.ClientSize = new System.Drawing.Size(504, 357); 
this.Controls.Add(this.tabControl1); 
this.Name = "Form1"; 
this.Text = "Form1"; 
this.tabControl1.ResumeLayout(false); 
this.tabPage1.ResumeLayout(false); 
this.tabPage2.ResumeLayout(false); 
this.ResumeLayout(false); 
} 
#endregion 
/// <summary> 
/// 应用程序的主入口点。 
/// </summary> 
[STAThread] 
static void Main() 
{ 
Application.Run(new Form1()); 
} 
//得到钥匙信息 
private void button1_Click(object sender, System.EventArgs e) 
{ 
crypt=new RSACryptoServiceProvider(); 
publickey=crypt.ToXmlString(false); 
richtext.Text="导出秘匙的情况下:\n"+publickey+"\n"; 
privatekey=crypt.ToXmlString(true); 
string info="仅仅导出公匙的情况下:\n"+privatekey+"\n"; 
richtext.AppendText(info); 
crypt.Clear(); 
} 
//保存公匙信息 
private void button2_Click(object sender, System.EventArgs e) 
{ 
save=new SaveFileDialog(); 
save.Filter="File Text (*.txt)|*.txt|All File (*.*)|*.*"; 
save.ShowDialog(); 
publicinfo=save.FileName; 
} 
//保存密匙信息 
private void button3_Click(object sender, System.EventArgs e) 
{ 
save=new SaveFileDialog(); 
save.Filter="File Text (*.txt)|*.txt|All File (*.*)|*.*"; 
save.ShowDialog(); 
privateinfo=save.FileName; 
} 
//把钥匙信息写入文件 
private void button6_Click(object sender, System.EventArgs e) 
{ 
StreamWriter one=new StreamWriter(publicinfo,true,UTF8Encoding.UTF8); 
one.Write(publickey); 
StreamWriter two=new StreamWriter(privateinfo,true,UTF8Encoding.UTF8); 
two.Write(privatekey); 
one.Flush(); 
two.Flush(); 
one.Close(); 
two.Close(); 
MessageBox.Show("成功保存公匙和密匙!"); 
} 
//用公匙加密 
private void button4_Click(object sender, System.EventArgs e) 
{ 
crypt=new RSACryptoServiceProvider(); 
UTF8Encoding enc=new UTF8Encoding(); 
bytes=enc.GetBytes(textBox1.Text); 
crypt.FromXmlString( readpublickey ); 
bytes = crypt.Encrypt( bytes,false ); 
string encryttext=enc.GetString(bytes);//encryptbyte); 
richtext2.Text="加密结果:\n"+encryttext+"\n"+"加密结束!"; 
} 
private void button5_Click(object sender, System.EventArgs e) 
{ 
UTF8Encoding enc=new UTF8Encoding(); 
byte [] decryptbyte; 
crypt.FromXmlString ( readprivatekey ) ; 
decryptbyte = crypt.Decrypt( bytes,false ); 
string decrypttext=enc.GetString( decryptbyte ); 
richtext3.Text = "解密结果:\n" + decrypttext + "\n" + "解密结束!" ; 
} 
//从文件中读取公匙信息 
private void button7_Click(object sender, System.EventArgs e) 
{ 
StreamReader sr ; 
open = new OpenFileDialog( ); 
open.Filter="Text File (*.txt)|*.txt|All File (*.*)|*.* "; 
// open.ShowDialog(); 
if(open.ShowDialog()==DialogResult.OK) 
{ 
sr = new StreamReader(open.FileName,UTF8Encoding.UTF8); 
} 
else 
{ 
MessageBox.Show("发生错误!"); 
return; 
} 
readpublickey = sr.ReadToEnd(); 
sr.Close(); 
} 
//从文件中读取私匙信息 
private void button8_Click(object sender, System.EventArgs e) 
{ 
open = new OpenFileDialog( ); 
open.Filter="Text File (*.txt)|*.txt|All File (*.*)|*.* "; 
open.ShowDialog(); 
StreamReader sr = new StreamReader(open.FileName,UTF8Encoding.UTF8); 
readprivatekey = sr.ReadToEnd(); 
sr.Close(); 
} 
} 
}
‘肆’ VB.NET开发的软件,大家一般都是怎么加密的
网上有很多专业的加密教程
最适合小开发者的软件加密方式就是下面这个
获取硬件信息和个人注册时的姓名手机号等一系列信息,通过预先设定好的加密函数进行散列加密,生成一个只有本人本机能使用的序列号,软件正版授权的时候用同样的方式生成序列号进行比对,一样则通过
‘伍’ ASP.NET系统中如何实现软件加密、授权
安装系统的时候获取cpu 和网卡号 形成注册号
写到注册表中
安装完成后要求输入注册号,把输入的值存放到某个文件(比如xml文件中),如果错误要提示
void Application_Start(object sender, EventArgs e) 
application变量 
在系统启动的时候就读取写在注册表中的key和xml文件中保存的序列号  不同则提示 并退出
‘陆’ 用VB.net编写一个加密解密软件
"采用DES算法"这个说法不明确,首先是使用多少位的DES进行加密,通常是128位或192位,其次是,要先把主密钥转化成散列,才能供DES进行加密,转化的方法是什么没有明确,通常是md5,所以有的银行卡说是128位md5 3DS就是指用md5转换主密钥散列,用DES进行加密,但是DES本身是64位(包含校验码),2DES是128位,3DES是192位,但是没有2DES的叫法,所以128位、192位统称3DES
要完整的md5+3DS实例,需要100分以上,要不到我的空间中查找相关的文章
‘柒’ C#NET怎么实现IDEA加密算法
1、数据加密的基本过程就是对原来为明文的文件或数据按某种算法进行处理,使其成为不可读的一段代码,通常称为“密文”,使其只能在输入相应的密钥之后才能显示出本来内容,通过这样的途径来达到保护数据不被非法人窃取、阅读的目的。
2、常见加密算法
DES(Data Encryption Standard):数据加密标准,速度较快,适用于加密大量数据的场合;
3DES(Triple DES):是基于DES,对一块数据用三个不同的密钥进行三次加密,强度更高;
RC2和 RC4:用变长密钥对大量数据进行加密,比 DES 快;
IDEA(International Data Encryption Algorithm)国际数据加密算法:使用 128 位密钥提供非常强的安全性;
RSA:由 RSA 公司发明,是一个支持变长密钥的公共密钥算法,需要加密的文件块的长度也是可变的;
DSA(Digital Signature Algorithm):数字签名算法,是一种标准的 DSS(数字签名标准);
AES(Advanced Encryption Standard):高级加密标准,是下一代的加密算法标准,速度快,安全级别高,目前 AES 标准的一个实现是 Rijndael 算法;
BLOWFISH,它使用变长的密钥,长度可达448位,运行速度很快;
其它算法,如ElGamal、Deffie-Hellman、新型椭圆曲线算法ECC等。
比如说,MD5,你在一些比较正式而严格的网站下的东西一般都会有MD5值给出,如安全焦点的软件工具,每个都有MD5。 
3、例程:
#include<stdio.h>
#include<process.h>
#include<conio.h>
#include<stdlib.h>
#define maxim 65537
#define fuyi 65536
#define one 65536
#define round 8
unsigned int inv(unsigned int xin);
unsigned int mul(unsigned int a,unsigned int b);
void cip(unsigned int IN[4],unsigned int OUT[4],unsigned int Z[7][10]);
void key(unsigned int uskey[9],unsigned int Z[7][10]);
void de_key(unsigned int Z[7][10],unsigned int DK[7][10]);
void main()
{ 
 int i,j,k,x;
    unsigned int Z[7][10],DK[7][10],XX[5],TT[5],YY[5];
    unsigned int uskey[9];
FILE *fpout,*fpin;
printf("\n Input Key");
for(i=1;i<=8;i++)
    scanf("%6u",&uskey[i]);
for(i=0;i<9;i++)
    uskey[i]=100+i*3;
    key(uskey,Z);/*产生加密子密钥*/
    de_key(Z,DK);/*计算解密子密钥*/
    if((fpin=fopen("ekey.txt","w"))==NULL)
    {
    printf("cannot open file!");
    exit(EXIT_FAILURE);
    }
    for(i=0;i<7;i++)
    {
    for(j=0;j<10;j++)
    fprintf(fpin,"%6u",Z[i][j]);
    fprintf(fpin,"\n");
    }
    fclose(fpin);
    
    /*XX[1..5]中为明文*/
    for(i=0;i<4;i++) XX[i]=2*i+101;
    clrscr();
    printf("Ming wen %6u %6u %6u %6u \n",XX[0],XX[1],XX[2],XX[3]);
    if((fpin=(fopen("ideaming.txt","w")))==NULL)
    {printf("cannot open file!");
    exit(EXIT_FAILURE);
    }
    fprintf(fpin,"%6u,%6u,%6u,%6u \n",XX[0],XX[1],XX[2],XX[3]);
    fclose(fpin);
    for(i=1;i<=30000;i++)
    cip(XX,YY,Z);/*用密钥Z加密XX中的明文并存在YY中*/
    printf("\n\n Mingwen %6u %6u %6u %6u \n",YY[0],YY[1],YY[2],YY[3]);
 if((fpin=fopen("ideamiwn.txt","w"))==NULL)
 {
 printf("cannot open file!");
    exit(EXIT_FAILURE);
    }
    fprintf(fpout,"%6u %6u %6u %6u\n",YY[0],YY[1],YY[2],YY[3]);
    {
    printf("cannot open file!");
    exit(EXIT_FAILURE);
    }
    fprintf(fpout,"%6u %6u %6u %6u \n",YY[0],YY[1],YY[2],YY[3]);
    fclose(fpout);
    for(i=1;i<=30000;i++)
    cip(YY,TT,DK);/*encipher YY to TT with Key DK*/
    printf("\n Jie Mi %6u %6u %6u %6u \n",TT[0],TT[1],TT[2],TT[3]);
    if((fpout=fopen("dideaout.txt","w"))==NULL)
    {
    printf("cannot open file!");
    exit(EXIT_FAILURE);
    }
    fprintf(fpout,"%6u %6u %6u %6u \n",TT[0],TT[1],TT[2],TT[3]);
    fclose(fpout);
    }
    /* 此函数执行IDEA算法中的加密过程*/
    
    void cip(unsigned int IN[4],unsigned int OUT[4],unsigned int Z[7][10])
    {
    unsigned int r,x1,x2,x3,x4,kk,t1,t2,a;
    x1=IN[0];x2=IN[1];x3=IN[2];x4=IN[3];
    for(r=1;r<=8;r++)
    {
    /* 对64位的块进行分组运算*/
    x1=mul(x1,Z[1][r]);x4=mul(x4,Z[4][r]);
    x2=x2+Z[2][r]&one;x3=(x3+Z[3][r])&one;
    /* MA结构的函数 */
    kk=mul(Z[5][r],(x1^x3));
    t1=mul(Z[6][r],(kk+(x2^x4))&one;
    /* 随机变换PI*/
    x1=x1^t1;x4=x4^t2;a=x2^t2;x2=x3^t1;x3=a;
    }
    /* 输出转换*/
    OUT[0]=mul(x1,Z[1][round+1]);
    OUT[3]=mul(x4,Z[1][round+1]);
    OUT[1]=(x3+Z[2][round+1])&one;
    OUT[2]=(x2+Z[3][round+1])&one;
    }
    
    /* 用高低算法上实现乘法运算*/
    unsigned int mul(unsigned int a,unsigned int b)
    {
    long int p;
    long unsigned q;
    if(a==0) p=maxim-b;
    else if(b==0) p=maxim-a;
    else
    {
    q=(unsigned long)a*(unsigned long)b;
    p=(q&one)-(q>>16);
    if(p<=0) p=p+maxim;
    {
    return (unsigned) (p&one);
    }
    
    /*通过Euclidean gcd算法计算xin的倒数*/
    unsigned int inv(unsigned int xin)
    {
    long n1,n2,q,r,b1,b2,t;
    if(xin==0)
    b2=0;
    else
    {n1=maxim;n2=xin;b2=1;b1=0;
    do{
    r=(n1%n2);q=(n1-r)/n2;
    if(r==0)
    if(b2<0) b2=maxim+b2;
    else
    {n1=n2;n2=r;
    t=b2;
    b2=b1-q*b2;b1=t;
    }
    }while(r!=0);
    }
    return (unsigned long int)b2;
    }
/*产生加密子密钥Z*/
    void key(unsigned int uskey[9],unsigned int Z[7][10])
    {
    unsigned int S[54];
    int i,j,r;
    for(i=1;i<9;i++)
    S[i-1]=uskey[i];
    /* shifts */
    for(i=8;i<54;i++)
    {
    if(i+2)%8==0)/* 对于S[14],S[22],...进行计算 */
    S[i]=((S[i-7]<<0)^(S[i-14]>>7)&one;
    else if((i+1)%8==0)/* 对于S[15],S[23],...进行计算 */
    S[i]=((S[i-15]<<9)^(S[i-14]>>7)&one;
    else
    S[i]=((S[i-7]<<9)^(S[i-6]>>7)&one;
    }
    /*取得子密钥*/
    for(r=1;r<=round+1;r++)
      for(j=1;j<7;j++)
      Z[j][r]=S[6*(r-1)+j-1];
    }
    
    /* 计算解子密钥DK */
    void de_key(unsigned int Z[7][10],unsigned int DK[7][10])
    {
    int j;
    for(j=1;j<=round+1;j++)
    {DK[1][round-j+2]=inv(Z[1][j]);
    DK[4][round-j+2]=inv(Z[4][j]);
    if(i==1|j==round+1)
    {
    DK[2][round-j+2]=(fuyi-Z[2][j])&one;
    DK[3][round-j+2]=(fuyi-Z[3][j])&one;
    }
    else
    {
    DK[2][round-j+2]=inv(Z[3][j]);
    DK[3][round-j+2]=inv(Z[2][j]);
    }
    }
    for(j=1;j<=round+1;j++)
    {
    DK[5][round-j+2]=inv(Z[5][j]);
    DK[6][round-j+2]=inv(Z[6][j]);
    }
    
    }
‘捌’ 怎么给asp.net的代码加密呀,也就是说怎么保护.aspx的源程序.
asp.net不需要加密,
它的程序会自动编译成DLL。
aspx页面只是页面部分,真正的程序在.VB OR .cs文件中。
编译后就不需要这些文件啊。
‘玖’ VB.NET做的一个行业小软件,请问如何加密,比如需要通过什么硬件的序列号注册;
最好的加密就是通过你的网站去加密!用网络服务器验证把一些主要程序都可以加载到服务器上!这样你的程序加密就完美了!(个人观点纯属不懂装懂的。哈哈见笑)
‘拾’ net程序加密C#开发软件的源代码怎么加密
一般的加密,通过反编译和跟踪程序运行都不难破解,所以不仅要加密,还要阻止编译,防范跟踪。这是很专业的,市场上有很多现成加密狗产品,可以方便地解决这个问题。源代码只能采取保密措施,加密是不行的。