A cryptographic library that wraps the .NET System.Security.Cryptography
library with opinionated defaults.
Features:
- Asymetric encryption using
RSA
- Symetric encryption using
AES
- Signing using
RSA
- Hash using
SHA256
Is supported using the RSACrypto
class passing in the public and private key, e.g.
var rsa = new RSACrypto(pk, p);
The class exposes two methods: EncryptData
and DecryptData
.
Is supported using the AESCryto
class, e.g.
var aes = new AESCrypto();
Internally the class initializes the key and initialization vector used by the underlaying AESCryptoServiceProvider
.
The class exposes two methods: EncryptData
and DecryptData
.
To sign use the class SignCrypto
passing in the public and private key, e.g.
var sign = new SignCrypto(pk, p);
The class exposes two main methods: SignData
and VerifyData
. Furthermore the class also contains a HashData
methods to do SHA256
hashing of the data-to-be-signed.