libsodium.PKI.SealData
Andrew Lambert edited this page Jan 21, 2023
·
9 revisions
Protected Function SealData(ClearText As MemoryBlock, RecipientPublicKey As libsodium.PKI.PublicKey, Exportable As Boolean = False) As MemoryBlock
Name | Type | Comment |
---|---|---|
ClearText | MemoryBlock | The data to be encrypted. |
RecipientPublicKey | PublicKey | The public half of the recipient's encryption key pair. |
Exportable | Boolean | Optional. If True then the return value is encoded in a text-based export format; otherwise the raw binary data is returned. |
The sealed ClearText
prepended with a Poly1305 message authentication code, or Nil
on error.
Encrypts the ClearText
using an ephemeral key pair, whose secret part is destroyed right after the encryption process. Only the recipient can decrypt these messages, using their private key, and while the recipient can verify the integrity of the message they cannot verify the identity of the sender.
If Exportable=True
then the return value is the sealed message encoded in a plain text format. Both the raw binary and plain text format are understood by the UnsealData
method.
- UnsealData
- Sealed boxes in the libsodium documentation.
Wiki home | Project page | Bugs
Text and code examples are Copyright ©2016-23 Andrew Lambert, offered under the CC BY-SA 3.0 License.