Reputation: 13517
here are my methods for encrypting and decrypting data using RSA:
private RSACryptoServiceProvider _RSACSP { get; set; }
public byte[] Encrypt(byte[] value, bool doOAEPPadding)
{
try
{
return (this._RSACSP.Encrypt(value, doOAEPPadding));
}
catch
{
return (null);
}
}
public byte[] Decrypt(byte[] value, bool doOAEPPadding)
{
try
{
return (this._RSACSP.Decrypt(value, doOAEPPadding));
}
catch
{
return (null);
}
}
Now, how do I use this._RSACSP.VerifyData(...);
to verify the encrypted data? I looked around and everything mentions SHA1
, except I'm not even sure that's in use here.
Any help is appreciated.
Upvotes: 0
Views: 846
Reputation: 273274
You do not use (or need) it to verify the outcome of Encrypt/Decrypt.
VerifyData is used to verify a signature created with one of the SignData() overloads.
Signing data is another use of Asymmetric encryption.
Upvotes: 2