> For the complete documentation index, see [llms.txt](https://libsodium.gitbook.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://libsodium.gitbook.io/doc/classical_cryptography.md). Agents can also search and read this documentation through its [MCP server](https://libsodium.gitbook.io/doc/~gitbook/mcp).

# Classical cryptography

These public-key APIs use Curve25519 or Ed25519 without a post-quantum component. Use them when an existing protocol or file format requires them.

They do not protect against an attacker with a sufficiently powerful quantum computer.

For new public-key encryption, use [key encapsulation (`crypto_kem`)](https://libsodium.gitbook.io/doc/public-key_cryptography/key_encapsulation.md) to establish a shared secret, then encrypt the message with an [AEAD](https://libsodium.gitbook.io/doc/secret-key_cryptography/aead.md) or [`crypto_secretbox`](https://libsodium.gitbook.io/doc/secret-key_cryptography/secretbox.md).

Key encapsulation does not authenticate the sender or replace a digital signature.

## Classical public-key APIs

* [Authenticated encryption (`crypto_box`)](https://libsodium.gitbook.io/doc/classical_cryptography/authenticated_encryption.md) encrypts messages between parties that know each other’s public keys.
* [Sealed boxes (`crypto_box_seal`)](https://libsodium.gitbook.io/doc/classical_cryptography/sealed_boxes.md) encrypt to a recipient without identifying the sender.
* [Key exchange (`crypto_kx`)](https://libsodium.gitbook.io/doc/classical_cryptography/key_exchange.md) derives separate transmit and receive keys from the peers’ key pairs.
* [Signatures (`crypto_sign`)](https://libsodium.gitbook.io/doc/classical_cryptography/public-key_signatures.md) sign messages and verify Ed25519 signatures.

## Low-level operations

The [X25519 scalar multiplication](https://libsodium.gitbook.io/doc/classical_cryptography/scalar_multiplication.md), [Ed25519 to Curve25519 key conversion](https://libsodium.gitbook.io/doc/classical_cryptography/ed25519-curve25519.md), [Edwards25519 arithmetic](https://libsodium.gitbook.io/doc/classical_cryptography/point-arithmetic.md), and [Ristretto255](https://libsodium.gitbook.io/doc/classical_cryptography/point-arithmetic/ristretto.md) pages document building blocks for protocols that specify these operations.
