Decrypts encrypted data by using Twofish cipher.
Unit
Syntax
ParametersAKey [in] A key for decryption. Comes from TwofishDeriveKey function or TwofishInitKey function.
AEncryptedData [in] A data to decrypt. Must be in little-endian format.
AData [out] A decrypted AEncryptedData's "clear text" data. Must be deleted with FreeMem function (but we recommend to use SecureFree function instead). Will have different size from AData. PKCS#5 padding will be removed.
ADataSize [in, out] On input: size of AEncryptedData. On output: size of AData.
AInitVector [in, opt] An optional initialization vector (IV). This value must be the same as the one passed to TwofishEncrypt function during encryption.
AEncryptedData [in] Encrypted data (in string form) to decrypt. Must not contain salt (see TwofishDeriveKey). Must be in little-endian format.
Return valueDecrypted "clear text" data. PKCS#5 padding will be removed.
RemarksThis function decrypts data previosly encrypted with TwofishEncrypt function with key of symmetric Twofish cipher. The encrypted data is passed in AEncryptedData parameter. The function outputs decrypted data back to AData parameter. AData expected to have different size from AEncryptedData. In other words, symmetric decryption with Twofish does change the size of the data.
The overload variant with RawByteString decrypts AEncryptedData parameter and outputs decrypted data as function's result.
See also
|