vb.net密鑰認(rèn)證 vb2015的產(chǎn)品密鑰

vb.net中實(shí)現(xiàn)rsa加密解密 急!急!

我覺得你的并不是RSA加密解密算法。

創(chuàng)新互聯(lián)建站是一家專業(yè)提供南沙企業(yè)網(wǎng)站建設(shè),專注與做網(wǎng)站、成都網(wǎng)站建設(shè)、H5場景定制、小程序制作等業(yè)務(wù)。10年已為南沙眾多企業(yè)、政府機(jī)構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)網(wǎng)站制作公司優(yōu)惠進(jìn)行中。

在.net的有一個(gè)System.Security.Cryptography的命名空間,里面有一RSACryptoServiceProvider的類用來對byte進(jìn)行RSA加密解密。

具體例子如下:

using System;

using System.Security.Cryptography;

using System.Text;

class RSACSPSample

{

static void Main()

{

try

{

//Create a UnicodeEncoder to convert between byte array and string.

UnicodeEncoding ByteConverter = new UnicodeEncoding();

//Create byte arrays to hold original, encrypted, and decrypted data.

byte[] dataToEncrypt = ByteConverter.GetBytes("Data to Encrypt");

byte[] encryptedData;

byte[] decryptedData;

//Create a new instance of RSACryptoServiceProvider to generate

//public and private key data.

RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();

//Pass the data to ENCRYPT, the public key information

//(using RSACryptoServiceProvider.ExportParameters(false),

//and a boolean flag specifying no OAEP padding.

encryptedData = RSAEncrypt(dataToEncrypt,RSA.ExportParameters(false), false);

//Pass the data to DECRYPT, the private key information

//(using RSACryptoServiceProvider.ExportParameters(true),

//and a boolean flag specifying no OAEP padding.

decryptedData = RSADecrypt(encryptedData,RSA.ExportParameters(true), false);

//Display the decrypted plaintext to the console.

Console.WriteLine("Decrypted plaintext: {0}", ByteConverter.GetString(decryptedData));

}

catch(ArgumentNullException)

{

//Catch this exception in case the encryption did

//not succeed.

Console.WriteLine("Encryption failed.");

}

}

static public byte[] RSAEncrypt(byte[] DataToEncrypt, RSAParameters RSAKeyInfo, bool DoOAEPPadding)

{

try

{

//Create a new instance of RSACryptoServiceProvider.

RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();

//Import the RSA Key information. This only needs

//toinclude the public key information.

RSA.ImportParameters(RSAKeyInfo);

//Encrypt the passed byte array and specify OAEP padding.

//OAEP padding is only available on Microsoft Windows XP or

//later.

return RSA.Encrypt(DataToEncrypt, DoOAEPPadding);

}

//Catch and display a CryptographicException

//to the console.

catch(CryptographicException e)

{

Console.WriteLine(e.Message);

return null;

}

}

static public byte[] RSADecrypt(byte[] DataToDecrypt, RSAParameters RSAKeyInfo,bool DoOAEPPadding)

{

try

{

//Create a new instance of RSACryptoServiceProvider.

RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();

//Import the RSA Key information. This needs

//to include the private key information.

RSA.ImportParameters(RSAKeyInfo);

//Decrypt the passed byte array and specify OAEP padding.

//OAEP padding is only available on Microsoft Windows XP or

//later.

return RSA.Decrypt(DataToDecrypt, DoOAEPPadding);

}

//Catch and display a CryptographicException

//to the console.

catch(CryptographicException e)

{

Console.WriteLine(e.ToString());

return null;

}

}

}

[Visual Basic]

Try

'Create a new RSACryptoServiceProvider object.

Dim RSA As New RSACryptoServiceProvider()

'Export the key information to an RSAParameters object.

'Pass false to export the public key information or pass

'true to export public and private key information.

Dim RSAParams As RSAParameters = RSA.ExportParameters(False)

Catch e As CryptographicException

'Catch this exception in case the encryption did

'not succeed.

Console.WriteLine(e.Message)

End Try

[C#]

try

{

//Create a new RSACryptoServiceProvider object.

RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();

//Export the key information to an RSAParameters object.

//Pass false to export the public key information or pass

//true to export public and private key information.

RSAParameters RSAParams = RSA.ExportParameters(false);

}

catch(CryptographicException e)

{

//Catch this exception in case the encryption did

//not succeed.

Console.WriteLine(e.Message);

}

VB.net 中如何實(shí)現(xiàn)序列號注冊功能

思路是:

讀取電腦硬件的信息,用隨機(jī)數(shù)加工這些信息后在注冊表中做個(gè)記錄,用這個(gè)記錄生成注冊碼送回給你,你按特定的方法生成序列號,你的小程序收到序列號后還原成數(shù)據(jù),數(shù)據(jù)比較注冊表中的記錄,如果正確就加入第二部分注冊的信息完成注冊.你的程序每次打開時(shí),先比對硬件信息-第一注冊信息-第二注冊信息,看這三者是否統(tǒng)一,不統(tǒng)一的就是使用期軟件.

也可以省了第一注冊信息,直接發(fā)硬件信息給你生成序列號,其他的相同.

vb.net2012的產(chǎn)品密鑰是多少?

需要激活的是vs,vb是vs里的集成模板工具

Microsoft Visual Studio Ultimate 2012 旗艦版 有效注冊密鑰:

YKCW6-BPFPF-BT8C9-7DCTH-QXGWC

- Microsoft Visual Studio Premium 2012 高級版 有效注冊密鑰:

MH2FR-BC9R2-84433-47M63-KQVWC

- Microsoft Visual Studio Professional 2012 專業(yè)版 有效注冊密鑰:

4D974-9QX42-9Y43G-YJ7JG-JDYBP

VB.NET做的一個(gè)行業(yè)小軟件,請問如何加密,比如需要通過什么硬件的序列號注冊;

最好的加密就是通過你的網(wǎng)站去加密!用網(wǎng)絡(luò)服務(wù)器驗(yàn)證把一些主要程序都可以加載到服務(wù)器上!這樣你的程序加密就完美了! (個(gè)人觀點(diǎn)純屬不懂裝懂的。哈哈見笑)

名稱欄目:vb.net密鑰認(rèn)證 vb2015的產(chǎn)品密鑰
本文鏈接:http://bm7419.com/article42/dohjphc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營銷推廣、微信公眾號、ChatGPT軟件開發(fā)、Google、虛擬主機(jī)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

微信小程序開發(fā)