Encrypts "clear text" data by using RSA cipher.
Unit
Syntax
ParametersAKey [in] A key for encryption. Comes from RSAGenKey function or RSALoadPublicKey function. A public key will be used.
AData [in] A data to encrypt.
AEncryptedData [out] An encrypted AData's data. Must be deleted with FreeMem function (but we recommend to use SecureFree function instead). Will have different size from AData. Data is returned in little-endian format.
ADataSize [in, out] On input: size of AData. On output: size of AEncryptedData (will be different).
AData [in] String "clear text" data to encrypt.
AInPlaceData [in, out] On input: "clear text" buffer to encrypt. On output: encrypted buffer (same size, little-endian).
Return valueEncrypted AData's data in a string form. Data is returned in little-endian format.
RemarksThis function encrypts data passed in AData parameter with public key of asymmetric RSA cipher and outputs encrypted data back to AEncryptedData parameter. AEncryptedData expected to have different size from original AData. In other words, asymmetric encryption with RSA does change the size of the data.
The overload variant with RawByteString encrypts AData parameter and outputs encrypted data as function's result.
The overload variant with AInPlaceData encrypts data "in place".
Examples
See also
|