-
-
Notifications
You must be signed in to change notification settings - Fork 3
libsodium.SKI.DecryptData
Andrew Lambert edited this page Nov 26, 2022
·
6 revisions
Protected Function DecryptData(CipherText As MemoryBlock, Key As libsodium.SKI.SecretKey, Nonce As MemoryBlock) As MemoryBlock
Name | Type | Comment |
---|---|---|
CipherText | MemoryBlock | The data to be decrypted. |
Key | SecretKey | The secret key. |
Nonce | MemoryBlock | The random nonce used to encrypt the CipherText . |
The decrypted CipherText
, or Nil
on error.
Decrypts the CipherText
using the XSalsa20 stream cipher with a secret key and a Nonce. A Poly1305 message authentication code is prepended by the EncryptData
method and will be validated by this method. An authentic message is decrypted and returned. If the CipherText
is inauthentic, failed to decrypt, or any other error occurs then this method returns Nil
.
If the CipherText
is encoded using the text-based export format then you may pass Nil
as the Nonce
parameter to use the nonce value encoded in the CipherText
.
- Secret key decryption example
- EncryptData
- Authenticated encryption in the libsodium documentation.
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2016-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.