@@ -253,7 +253,7 @@ namespace IRaCIS.Application.Services
|
||||
public string Code { get; set; }
|
||||
}
|
||||
|
||||
public IResponseOutput TestEncreptTest(TestEncrept testModel)
|
||||
public IResponseOutput TestEncreptTest(TestEncrept testModel)
|
||||
{
|
||||
return ResponseOutput.Ok(testModel);
|
||||
}
|
||||
@@ -276,6 +276,12 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
var _IRCEncreptOption = _encreptResponseMonitor.CurrentValue;
|
||||
|
||||
var publicKey = Encoding.UTF8.GetString(Convert.FromBase64String(_IRCEncreptOption.Base64RSAPublicKey));
|
||||
var privateKey = Encoding.UTF8.GetString(Convert.FromBase64String(_IRCEncreptOption.Base64RSAPrivateKey));
|
||||
|
||||
Console.WriteLine(RSAEncryption.Encrypt(publicKey, MD5Helper.Md5("123456")));
|
||||
|
||||
|
||||
string plainText = "Hello, BouncyCastle!";
|
||||
string key = "12345678901234567890123456789012"; // AES 密钥长度应为 16 字节(128 位)
|
||||
string iv = "your-iv-12345678"; // IV 长度为 16 字节
|
||||
@@ -320,13 +326,12 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
|
||||
|
||||
var publicKey = Encoding.UTF8.GetString(Convert.FromBase64String(_IRCEncreptOption.Base64RSAPublicKey));
|
||||
var privateKey = Encoding.UTF8.GetString(Convert.FromBase64String(_IRCEncreptOption.Base64RSAPrivateKey));
|
||||
|
||||
|
||||
Console.WriteLine("Public Key:");
|
||||
Console.WriteLine(privateKey);
|
||||
Console.WriteLine("\nPrivate Key:");
|
||||
Console.WriteLine(publicKey);
|
||||
Console.WriteLine("\nPrivate Key:");
|
||||
Console.WriteLine(privateKey);
|
||||
|
||||
Console.WriteLine("encrept sys Key:");
|
||||
Console.WriteLine($"\n{RSAEncryption.Encrypt(publicKey, key)}");
|
||||
|
||||
Reference in New Issue
Block a user