包含vb.netplc解密的詞條
廣州龍躍自動(dòng)化專(zhuān)業(yè)破解解密各類(lèi)plc加密,全國(guó)24小時(shí)聯(lián)系手機(jī):18520649527 【關(guān)技術(shù)】 微信:guanshiyou009如有任何問(wèn)題請(qǐng)打手機(jī)或者添加微信,謝謝支持
PLC解密,全國(guó)上門(mén)PLC解密維修找龍躍自動(dòng)化PLC解密網(wǎng)vb.netplc解密,專(zhuān)業(yè)PLC解密師傅電話18520649527;提供三菱plc解密,臺(tái)達(dá)plc解密,西門(mén)子plc解密,信捷plc解密等各類(lèi)PLC解密及觸摸屏解密維修服務(wù), 【加微信:guanshiyou009】或者致電PLC解密師傅電話18520649527
簡(jiǎn)單VB.NET加密與解密
Private Function myEncrypt(ByVal Code As String) As String
Dim Result As String = ""
Dim CurrentChar As Char
For i As Integer = 0 To Code.Length - 1
CurrentChar = Code.Substring(i, 1)
Select Case Code.Substring(i, 1)
Case "Z"
Result = "a"
Case "z"
Result = "A"
Case Else
Result = Chr(Asc(CurrentChar) + 1)
End Select
Next
Return Result
End Function
'vb.net 2005 調(diào)試通過(guò)
vb.net中實(shí)現(xiàn)rsa加密解密 急!急!
我覺(jué)得你的并不是RSA加密解密算法。
在.net的有一個(gè)System.Security.Cryptography的命名空間,里面有一RSACryptoServiceProvider的類(lèi)用來(lái)對(duì)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 加密與解密的程序代碼
加密:
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
擴(kuò)展資料:
注意事項(xiàng)
編寫(xiě)加密程序,將用戶輸入的一個(gè)英文句子加密為加密字符串,然后輸出加密字符串。假設(shè)句子長(zhǎng)度不超過(guò)100個(gè)字符。
根據(jù)給定的句子加密函數(shù)原型SentenceEncoding,編寫(xiě)函數(shù)SentenceEncoding調(diào)用給定的字符加密函數(shù)CharEncoding完成句子加密。
然后,編寫(xiě)主程序提示用戶輸入英文句子,然后調(diào)用函數(shù)SentenceEncoding對(duì)句子加密,最后輸出加密后的句子。
字符加密規(guī)則為大寫(xiě)字母和小寫(xiě)字母均加密為其補(bǔ)碼, 我們定義ASCII碼值相加為’A’+’Z’即155的兩個(gè)大寫(xiě)字母互為補(bǔ)碼,ASCII碼值相加為’a’+’z’即219的兩個(gè)小寫(xiě)字母互為補(bǔ)碼。
空格用@代替,句號(hào)以#代替,其它字符用句點(diǎn)代替。
函數(shù)原型:
void SentenceEncoding(char *soure,char *code);
功能:對(duì)待加密字符串source加密后保存加密字符串到code.
參數(shù):char *soure,指向待加密句子的字符串指針;
char *code 指向加密字符串的字符串指針;
字符加密函數(shù)代碼。
[img]VB加密和解密數(shù)字
最簡(jiǎn)單的就是移位法:就是將數(shù)字加上(或者減掉)某個(gè)定值;
比如:加密的時(shí)候加上5
那么:
0 + 5 = 5 ?轉(zhuǎn)換成5
1 + 5 = 6 ?轉(zhuǎn)換成6
2 + 5 = 7 ?轉(zhuǎn)換成7
3 + 5 = 8 ?轉(zhuǎn)換成8
4 + 5 = 9 ?轉(zhuǎn)換成9
5 + 5 = 10 去掉十位 轉(zhuǎn)換成0
6 + 5 = 11 去掉十位 轉(zhuǎn)換成1
7 + 5 = 12 去掉十位 轉(zhuǎn)換成2
8 + 5 = 13 去掉十位 轉(zhuǎn)換成3
9 + 5 = 14 去掉十位 轉(zhuǎn)換成4
那么解密的時(shí)候,就減掉5。
對(duì)于小于5的數(shù)字,要加上10以后再減5。
請(qǐng)看附件:
PLC解密,全國(guó)上門(mén)PLC解密維修找龍躍自動(dòng)化PLC解密網(wǎng)vb.netplc解密,專(zhuān)業(yè)PLC解密師傅電話18520649527;提供三菱plc解密,臺(tái)達(dá)plc解密,西門(mén)子plc解密,信捷plc解密等各類(lèi)PLC解密及觸摸屏解密維修服務(wù), 【加微信:guanshiyou009】或者致電PLC解密師傅電話18520649527
廣州龍躍自動(dòng)化專(zhuān)業(yè)破解解密各類(lèi)plc加密,全國(guó)24小時(shí)聯(lián)系手機(jī):18520649527 【關(guān)技術(shù)】 微信:guanshiyou009如有任何問(wèn)題請(qǐng)打手機(jī)或者添加微信,謝謝支持