File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55namespace SafeCrypt . App . Usage ;
66
7- internal class RsaUsage
7+ internal static class RsaUsage
88{
9- internal protected async void Usage ( )
9+ internal static async void Execute ( )
1010 {
11+ Console . WriteLine ( "------- RSA Test Started -------" ) ;
12+
1113 // Example: Generate RSA keys
1214 var rsaKeyPair = KeyGenerators . GenerateRsaKeys ( 2048 ) ;
13-
1415 string rsaPublicKey = rsaKeyPair . Item1 ;
1516 string rsaPrivateKey = rsaKeyPair . Item2 ;
1617
1718 Console . WriteLine ( $ "pubic key { rsaPublicKey } ") ;
19+
20+ Console . WriteLine ( ) ;
21+
1822 Console . WriteLine ( $ "private key { rsaPrivateKey } ") ;
1923
2024 // Example: Encrypt and Decrypt using RSA
@@ -30,6 +34,8 @@ internal protected async void Usage()
3034
3135 Console . WriteLine ( $ "Original Data: { originalData } ") ;
3236
37+ Console . WriteLine ( ) ;
38+
3339 Console . WriteLine ( "Original byte array: " + BitConverter . ToString ( encryptedData . EncryptedData ) ) ;
3440 string EncryptedDataconvertedString = Convert . ToBase64String ( encryptedData . EncryptedData ) ;
3541
@@ -49,6 +55,8 @@ internal protected async void Usage()
4955 var decryptedData = await Rsa . DecryptAsync ( decryptionModel ) ;
5056 Console . WriteLine ( $ "{ decryptedData . DecryptedData } ") ;
5157
52- Console . ReadLine ( ) ;
58+ Console . WriteLine ( ) ;
59+
60+ Console . WriteLine ( "------- RSA Test Ended -------" ) ;
5361 }
5462}
You can’t perform that action at this time.
0 commit comments