From 5c18b5b2493f0856aaaeac6ce5390a6509c5c666 Mon Sep 17 00:00:00 2001 From: Ruben wihler <91421491+RubenWihler@users.noreply.github.com> Date: Wed, 6 Dec 2023 11:15:51 +0100 Subject: [PATCH] cleaned documentation --- readme.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index 0752220..2a5ad68 100644 --- a/readme.md +++ b/readme.md @@ -1,8 +1,8 @@ -# EncryptionManager Class Documentation +# HybridEncryption class Documentation ## Overview -The `EncryptionManager` class provides a set of methods for performing combined RSA and AES encryption and decryption in C#. This class enables the generation of RSA key pairs, encryption of text using a combination of RSA and AES, and subsequent decryption of the encrypted text. +The `HybridEncryption` class provides a set of methods for performing combined RSA and AES encryption and decryption in C#. This class enables the generation of RSA key pairs, encryption of text using a combination of RSA and AES, and subsequent decryption of the encrypted text. ## Table of Contents @@ -41,11 +41,13 @@ None #### Example ```csharp -var keys = EncryptionManager.GenerateRSAKeys(); +var keys = HybridEncryption.GenerateRSAKeys(); var publicKey = keys.publicKey; var privateKey = keys.privateKey; ``` +------------------------------------------------------------------------------------------------------------------------ + ## Text Encryption <a name="text-encryption"></a> ```csharp @@ -78,12 +80,14 @@ public static (string text, string aesKey, string aesIV) Encrypt(string text, st #### Example ```csharp -var encryptionResult = EncryptionManager.Encrypt("Hello, World!", publicKey); +var encryptionResult = HybridEncryption.Encrypt("Hello, World!", publicKey); var encryptedText = encryptionResult.text; var encryptedAESKey = encryptionResult.aesKey; var encryptedAESIV = encryptionResult.aesIV; ``` +------------------------------------------------------------------------------------------------------------------------ + ## Text Decryption <a name="text-decryption"></a> ```csharp @@ -116,7 +120,7 @@ public static string Decrypt(string encryptedText, string aesKey, string aesIV, #### Example ```csharp -var decryptedText = EncryptionManager.Decrypt(encryptedText, encryptedAESKey, encryptedAESIV, privateKey); +var decryptedText = HybridEncryption.Decrypt(encryptedText, encryptedAESKey, encryptedAESIV, privateKey); ``` ## Private Methods <a name="private-methods"></a> @@ -146,6 +150,8 @@ private static byte[] RsaEncrypt(string data, string publicKey) - The encrypted data. +------------------------------------------------------------------------------------------------------------------------ + ```csharp private static byte[] RsaDecrypt(string data, string privateKey) ``` @@ -171,6 +177,8 @@ private static byte[] RsaDecrypt(string data, string privateKey) - The decrypted data. +------------------------------------------------------------------------------------------------------------------------ + ```csharp private static byte[] AesEncrypt(string data, byte[] key, byte[] IV) ``` @@ -197,6 +205,8 @@ private static byte[] AesEncrypt(string data, byte[] key, byte[] IV) - The encrypted data. +------------------------------------------------------------------------------------------------------------------------ + ```csharp private static string AesDecrypt(byte[] cipherText, byte[] key, byte[] IV) ``` @@ -223,6 +233,8 @@ private static string AesDecrypt(byte[] cipherText, byte[] key, byte[] IV) - The decrypted data. +------------------------------------------------------------------------------------------------------------------------ + ```csharp private static (byte[] key, byte[] IV) GenerateAESKey() ``` -- GitLab