真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

vb.net代碼局部加密,用vb編寫程序加密代碼

vb.net如何寫DLL來加密ASP,解決即追100分

.net不知道怎么弄,vb倒是有文章

網(wǎng)站設計制作、成都網(wǎng)站設計的開發(fā),更需要了解用戶,從用戶角度來建設網(wǎng)站,獲得較好的用戶體驗。創(chuàng)新互聯(lián)公司多年互聯(lián)網(wǎng)經(jīng)驗,見的多,溝通容易、能幫助客戶提出的運營建議。作為成都一家網(wǎng)絡公司,打造的就是網(wǎng)站建設產(chǎn)品直銷的概念。選擇創(chuàng)新互聯(lián)公司,不只是建站,我們把建站作為產(chǎn)品,不斷的更新、完善,讓每位來訪用戶感受到浩方產(chǎn)品的價值服務。

asp編譯成dll-圖形化教程

生成的dll文件肯定要到注冊到服務器上才能用。

用法嘛,和asp內(nèi)置幾大象的用法類似(就是面向?qū)ο螅?,你在dll中寫一個類,類中定一個加密和解密的方法,在asp里面實例化(new)這個類,用來加解密就可以了。

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

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

在.net的有一個System.Security.Cryptography的命名空間,里面有一RSACryptoServiceProvider的類用來對byte進行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 加密與解密的程序代碼

加密:

Private?Function JiaMi(ByVal varPass As String) As String '參數(shù)varPass是需要加密的文本內(nèi)容

Dim varJiaMi As String * 20

Dim varTmp As Double

Dim strJiaMi As String

Dim I

For I = 1 To Len(varPass)

varTmp = AscW(Mid$(varPass, I, 1))

varJiaMi = Str$(((((varTmp * 1.5) / 5.6) * 2.7) * I))

strJiaMi = strJiaMi varJiaMi

Next?I

JiaMi = strJiaMi

End?Function

解密函數(shù):

Private?Function JieMi(ByVal varPass As String) As String '參數(shù)varPass是需要解密的密文內(nèi)容

Dim varReturn As String * 20

Dim varConvert As Double

Dim varFinalPass As String

Dim varKey As Integer

Dim varPasslenth As Long

varPasslenth = Len(varPass)

For I = 1 To varPasslenth / 20

varReturn = Mid(varPass, (I - 1) * 20 + 1, 20)

varConvert = Val(Trim(varReturn))

varConvert = ((((varConvert / 1.5) * 5.6) / 2.7) / I)

varFinalPass = varFinalPass ChrW(Val(varConvert))

Next?I

JieMi = varFinalPass

End?Function

擴展資料:

注意事項

編寫加密程序,將用戶輸入的一個英文句子加密為加密字符串,然后輸出加密字符串。假設句子長度不超過100個字符。

根據(jù)給定的句子加密函數(shù)原型SentenceEncoding,編寫函數(shù)SentenceEncoding調(diào)用給定的字符加密函數(shù)CharEncoding完成句子加密。

然后,編寫主程序提示用戶輸入英文句子,然后調(diào)用函數(shù)SentenceEncoding對句子加密,最后輸出加密后的句子。

字符加密規(guī)則為大寫字母和小寫字母均加密為其補碼, 我們定義ASCII碼值相加為’A’+’Z’即155的兩個大寫字母互為補碼,ASCII碼值相加為’a’+’z’即219的兩個小寫字母互為補碼。

空格用@代替,句號以#代替,其它字符用句點代替。

函數(shù)原型:

void SentenceEncoding(char *soure,char *code);

功能:對待加密字符串source加密后保存加密字符串到code.

參數(shù):char *soure,指向待加密句子的字符串指針;

char *code 指向加密字符串的字符串指針;

字符加密函數(shù)代碼。


網(wǎng)頁題目:vb.net代碼局部加密,用vb編寫程序加密代碼
文章轉(zhuǎn)載:http://weahome.cn/article/hecoii.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部