Mono Class Library: System.Security.Cryptography.RSACryptoServiceProvider Overview | Members

System.Security.Cryptography.RSACryptoServiceProvider.EncryptValue Method

Raw (unpadded) encryption using the RSA public key. [Edit]

public override byte[] EncryptValue (byte[] rgb)

Parameters

rgb
The data to be encrypted. [Edit]

Returns

An array of bytes containing the encrypted data. [Edit]

Remarks

Note: This method is implemented in Mono but isn't supported in the Microsoft .NET framework. There are good reason for this:

  • Mono requires the method to implement the RSA Formatter and Deformatter classes.
  • Microsoft's CryptoAPI doesn't support direct RSA encryption/decryption.
  • You shouldn't be using them anyway!!! as this isn't the way to encrypt using RSA. You need to apply padding before encrypting (and remove it when decrypting). Not doing so is both dangerous (non secure) and very slow.
[Edit]

Requirements

Namespace: System.Security.Cryptography
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0