Dim rsa = new System.Security.Cryptography.RSACryptoServiceProvider()
Dim ByteConverter As New UnicodeEncoding()
Dim dataToEncrypt As Byte() = ByteConverter.GetBytes("ww我wData to Encrypt")
Dim encryptedData() As Byte
Dim decryptedData() As Byte
Dim gs As String = rsa.ToXmlString(False) '生成 公匙
Dim ss As String = rsa.ToXmlString(True) ''生成 私匙
rsa.FromXmlString(gs) '公匙
encryptedData = RSA.Encrypt(DataToEncrypt, False)
output.show("加密后:" & ByteConverter.GetString(encryptedData ))
rsa.FromXmlString(ss)
decryptedData= RSA.Decrypt(encryptedData, False)
output.show("解密后: " & ByteConverter.GetString(decryptedData))
自己搞定了!
[此贴子已经被作者于2018/1/3 8:32:32编辑过]
如果指定了 密钥怎么修改下程序呢?
比如 指定 密钥 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqIsuByJRAIL 对某字符串加密呢?
加密内容可以转 UTF-8吗
[此贴子已经被作者于2024/12/25 18:22:51编辑过]