Sealed boxes | Libsodium documentation
Only the recipient can decrypt these messages using their private key. While the recipient can verify the integrity of the message, they cannot verify the identity of the sender. A message is encrypted using an ephemeral key pair, with the secret key being erased right after the encryption process. Without knowing the secret key used for a given message, the sender cannot decrypt the message later. Furthermore, without additional data, a message cannot be correlated with the identity of its sender. The crypto_box_seal() function encrypts a message m of length mlen for a recipient whose public key is pk. It puts the ciphertext, whose length is crypto_box_SEALBYTES + mlen, into c. The function creates a new key pair for each message and attaches the public key to the ciphertext. The secret key is overwritten and is not accessible after this function returns. The crypto_box_seal_open() function decrypts the ciphertext c, whose length is clen, using the key pair (pk, sk) and puts the decry
⌘Ctrlk Sealed boxes Example #define MESSAGE (const unsigned char *) "Message" #define MESSAGE_LEN 7 #define CIPHERTEXT_LEN (crypto_box_SEALBYTES + MESSAGE_LEN) /* Recipient creates a long-term key pair */ unsigned char recipient_pk[crypto_box_PUBLICKEYBYTES]; unsigned char recipient_sk[crypto_box_SECRETKEYBYTES]; crypto_box_keypair(recipient_pk, recipient_sk); /* Anonymous sender encrypts a message using an ephemeral key pair * and the recipient's public key */ unsigned char ciphertext[CIPHERTEXT_LEN]; crypto_box_seal(ciphertext, MESSAGE, MESSAGE_LEN, recipient_pk); /* Recipient…
saved by
related reading
- iMessage with PQ3: The new state of the art in quantum-secure messaging at scale - Apple Security Researchsecurity.apple.com
- GitHub - MystenLabs/seal: Seal is a decentralized secrets management (DSM) service that relies on access control policies defined and validated on Sui.github.com
- A Cypherpunk's Manifestoactivism.net
- 293.pdfeprint.iacr.org
- Homomorphic encryption - Wikipediaen.wikipedia.org
- RSA Cryptography | CS70 Guidecs70.bencuan.me
- thesis.pdfaayushg.com
- Anamorphic-Resistant Encryption; Or Why the Encryption Debate is Still Aliveeprint.iacr.org
- WireGuard: Next Generation Kernel Network Tunnelwireguard.com
- iMessage, explained - JJTechjjtech.dev
- Public-Key Encryption | Computer Securitytextbook.cs161.org
- Skiff - Private, encrypted, and Web3 emailweb.archive.org