
正文
vb.net异或加密 vba异或
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
VB.NET开发的软件,大家一般都是怎么加密的
网上有很多专业的加密教程
最适合小开发者的软件加密方式就是下面这个
获取硬件信息和个人注册时的姓名手机号等一系列信息,通过预先设定好的加密函数进行散列加密,生成一个只有本人本机能使用的序列号,软件正版授权的时候用同样的方式生成序列号进行比对,一样则通过
相关问答
Q1: 设计一种很难被破解的异或加密方法??
3.99 icePub_encryptText2
l 函数原型:
int WINAPI icePub_encryptText2(char *strInput, char *strOutputHexstring, char *strKey)
输入:strInput 待加密文本数据串
strKey 单des密钥,8字节长度
输出:strOutputHexstring 加密后16进制串
返回码:
l VC连接Lib方式声明
__declspec(dllexport)
int WINAPI icePub_encryptText2(char *strInput, char *strOutputHexstring, char *strKey);
l 动态调用例程
VC sample代码:
char buff[1024],buff2[1024],key[1024];
int len=0;
strcpy(buff,"Take apart Letter Long, Listen Hidden Never-ending bitterness, Between Sky And Terra, Beartthrob Popple.");
strcpy(key,"11223344");
typedef int (WINAPI ICEPUB_ENCRYPTTEXT2)(char *strInput, char *strOutputHexstring, char *strKey);
ICEPUB_ENCRYPTTEXT2 *icePub_decryptText2 = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_decryptText=(ICEPUB_ENCRYPTTEXT2 *)GetProcAddress(hDLLDrv,"icePub_encryptText2");
}
if(icePub_decryptText2)
len=icePub_decryptText2(buff,buff2,key);
if(hDLLDrv)
FreeLibrary(hDLLDrv);
AfxMessageBox(buff2);
VB sample 代码:
Private Declare Function icePub_encryptText2 Lib "icePubDll.dll" (ByVal strInput As String,ByVal strOutputHexstring As String, ByVal strKey As String) As Integer
Dim len As Integer
Dim buff As String
Dim buff2 As String
Dim key As String
buff="Recall Dream Miss, Keep Silk-silk accept as a souvenir, Between You And Me, Stringed music touching."
key="11223344"
buff2=Space(1024)
len=icePub_encryptionText2(buff,buff2,key)
MsgBox buff2
3.100 icePub_decryptText2
l 函数原型:
int WINAPI icePub_decryptText2(char *strInputHexstring, char *strOutput, char *strKey)
输入:strInputHexstring 待解密16进制串,数据长度为16的倍数
strKey 单des密钥,8字节长度
输出:strOutput 解密后数据
返回码: 解密后数据最大长度,为8的倍数
l VC连接Lib方式声明
__declspec(dllexport)
int WINAPI icePub_decryptText2(char *strInputHexstring, char *strOutput, char *strKey);
l 动态调用例程
VC sample代码:
char buff[1024],buff2[1024],key[1024];
int len=0;
strcpy(buff,"CCF8732A28BA4B6EC7460F43DD95CAEA4E8D100DD35A7667469015EB5722E0C2452D0E66895ECF294E3EAF39473B386E5999D0633F19296A13A44AF0BFAA38A956FBE465A57BA19C5C5FC86754AD029B39CF587EDD4651E20D06A92B8608F6ECD19841F52462A5A020479871017620FE");
strcpy(key,"11223344");
typedef int (WINAPI ICEPUB_DECRYPTTEXT2)(char *strInputHexstring, char *strOutput, char *strKey);
ICEPUB_DECRYPTTEXT2 *icePub_decryptText2 = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_decryptText=(ICEPUB_DECRYPTTEXT2 *)GetProcAddress(hDLLDrv,"icePub_decryptText2");
}
if(icePub_decryptText2)
len=icePub_decryptText2(buff,buff2,key);
if(hDLLDrv)
FreeLibrary(hDLLDrv);
AfxMessageBox(buff2);
VB sample 代码:
Private Declare Function icePub_decryptText2 Lib "icePubDll.dll" (ByVal strInputHexstring As String, ByVal strOutput As String, ByVal strKey As String) As Integer
Dim len As Integer
Dim buff As String
Dim buff2 As String
Dim key As String
buff="CCF8732A28BA4B6EC7460F43DD95CAEA4E8D100DD35A7667469015EB5722E0C2452D0E66895ECF294E3EAF39473B386E5999D0633F19296A13A44AF0BFAA38A956FBE465A57BA19C5C5FC86754AD029B39CF587EDD4651E20D06A92B8608F6ECD19841F52462A5A020479871017620FE"
key="11223344"
buff2=Space(1024)
len= icePub_decryptText2(buff,buff2,key)
MsgBox buff2
Q2: vb.net中的xor怎么用?
xor表示双重作用,
textstyle = textstyle Xor FontStyle.Italic
就是说,在原来的基础上实现双重功能结合,比如你原来的字体是 加粗的,在运行这句语句后,就实验了加粗和倾斜的功能了,如果不用xor,实现就很麻烦了
Q3: vb.net中实现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);
}
Q4: 怎么用VB编一个加密文件
最简单vb.net异或加密的异或加密vb.net异或加密,二次加密实际上就是解密:
Private Sub Command1_Click()
Text2.Text = jiami(Text1.Text)
MsgBox jiami(Text2.Text)
End Sub
Private Function jiami(s As String) As String
Dim i As Long
For i = 1 To Len(s)
jiami = jiami Chr(Asc(Mid(s, i, 1)) Xor 72) '72相当于密钥vb.net异或加密,可以用别vb.net异或加密的数字
Next
End Function
Q5: vb加密算法
Private Sub Command1_Click()
Dim t As String
t = Text1.Text
Text2.Text = Encrypt(t, 177, 86)
End Sub
Private Sub Command2_Click()
Dim t As String
t = Text2.Text
Text4.Text = Encrypt(t, 177, 86)
End Sub
亲,你这两个按钮里面的代码都是加密的啊!
最基本的知识你都没有理解!哪有加密和解密都用一样的代码!
vb.net异或加密的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于vba异或、vb.net异或加密的信息别忘了在本站进行查找喔。







