> 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/advanced/stream_ciphers.md). Agents can also search and read this documentation through its [MCP server](https://libsodium.gitbook.io/doc/~gitbook/mcp).

# Stream ciphers

Sodium includes implementations of the Salsa20, XSalsa20, ChaCha20 and XChaCha20 stream ciphers.

These functions are stream ciphers. They do not provide authenticated encryption.

They can be used to generate pseudo-random data from a key, or as building blocks for implementing custom constructions, but they are not alternatives to `crypto_secretbox_*()`.

## Notes

The full-round stream ciphers listed here are expected to provide post-quantum confidentiality with a securely established 256-bit secret key and no nonce reuse. They do not authenticate ciphertexts.
