Hack Forums
[C#] LoctiteCrypto - easy and secure encryption/decryption class - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] LoctiteCrypto - easy and secure encryption/decryption class (/showthread.php?tid=5940501)



LoctiteCrypto - easy and secure encryption/decryption class - gigajew - Feb 12, 2019

This is encryption/decryption class that uses a combination between asymmetric RSA and symmetric AES to produce safe encryption. Almost like SSL. (Does not support Windows XP and below). Your data gets encrypted with AES using a random key and iv combination, and then the key to decrypt that data gets encrypted with a public key that the clients have. That way anyone, or any client can encrypt data but only you can decrypt it again with the private key.

Method list:
[*]public string GeneratePublicKey();
[*]public string GeneratePrivateKey();
[*]public string DecryptString(EncryptedBlob blob, string private_asymmetric_key);
[*]public byte[] DecryptData(EncryptedBlob blob, string private_asymmetric_key);
[*]public EncryptedBlob EncryptString(string raw_message, string public_asymmetric_key);
[*]public EncryptedBlob EncryptData(byte[] raw_binary_data, string public_asymmetric_key);
[*]public void Dispose();

Example usage:


Source code: