Skip to content

Commit c1f8600

Browse files
committed
remove rsa usage from program class
1 parent 4b71e03 commit c1f8600

1 file changed

Lines changed: 1 addition & 42 deletions

File tree

src/SafeCrypt.Test/Program.cs

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
using SafeCrypt.AESDecryption;
44
using SafeCrypt.AESEncryption;
5-
using SafeCrypt.Helpers;
65
using SafeCrypt.Models;
7-
using SafeCrypt.RsaEncryption;
8-
using SafeCrypt.RsaEncryption.Models;
96

107
var dataToEncrypt = "Data to Encrypt";
118
var secret = "hghjuytsdfraestwsgtere==";
@@ -39,42 +36,4 @@
3936
Console.WriteLine($"IV key: {decryptionData.Iv}");
4037
Console.WriteLine($"Secret key: {decryptionData.SecretKey}");
4138

42-
43-
44-
///////////////////////////
45-
///
46-
// Example: Generate RSA keys
47-
var rsaKeyPair = KeyGenerators.GenerateRsaKeys(2048);
48-
string rsaPublicKey = rsaKeyPair.Item1;
49-
string rsaPrivateKey = rsaKeyPair.Item2;
50-
51-
Console.WriteLine($"pubic key {rsaPublicKey}");
52-
Console.WriteLine($"private key {rsaPrivateKey}");
53-
54-
// Example: Encrypt and Decrypt using RSA
55-
string originalData = "Hello, RSA Encryption!";
56-
57-
var enModel = new RsaEncryptionParameters
58-
{
59-
DataToEncrypt = originalData,
60-
PublicKey = rsaPublicKey,
61-
};
62-
63-
var encryptedData = await Rsa.EncryptAsync(enModel);
64-
65-
var uccRYTED = new RsaDecryptionParameters
66-
{
67-
DataToDecrypt = encryptedData.EncryptedData,
68-
PrivateKey = rsaPrivateKey
69-
};
70-
71-
var decryptedData = await Rsa.DecryptAsync(uccRYTED);
72-
73-
// Display results
74-
Console.WriteLine($"Original Data: {originalData}");
75-
Console.WriteLine($"Encrypted Data: {encryptedData.EncryptedData}");
76-
//Console.WriteLine($"Encrypted Data-------: {BitConverter.ToString(encryptedData.EncryptedData)}");
77-
Console.WriteLine($"Decrypted Data: {decryptedData.DecryptedData}");
78-
79-
80-
Console.WriteLine("Hello, World!");
39+
Console.ReadLine();

0 commit comments

Comments
 (0)