> For the complete documentation index, see [llms.txt](https://cryptic-documentation.gitbook.io/cryptic-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cryptic-documentation.gitbook.io/cryptic-documentation/technology/2.-technology-overview/2.1-platform-architecture/tweetnacl.md).

# TweetNaCl

#### **What is NaCl?**

**NaCl (Networking and Cryptography Library)** is a high-speed cryptographic software library for network communication, encryption, decryption, signatures, and related cryptographic operations.

It was designed to make cryptography safer to use by providing a small set of high-level primitives that reduce the risk of developer mistakes.

* **Created by:** Daniel J. Bernstein, Tanja Lange, and Peter Schwabe
* **First released:** 2008
* **Language:** C, with bindings available in many languages
* **Philosophy:** NaCl avoids “easy to misuse” cryptography by offering a minimal set of secure primitives with simple APIs.

#### **What is TweetNaCl?**

**TweetNaCl** is a compact, self-contained reimplementation of NaCl in around 100 tweets worth of code. It was designed for portability, readability, and auditability.

* **Created by:** The same core team as NaCl
* **Language:** C, with JavaScript and other implementations available
* **Goal:** Provide a small, auditable cryptographic library with minimal dependencies

#### **Design Goals**

* **Security-first:** Cryptographic operations are designed to avoid common implementation mistakes.
* **High assurance:** Avoids unsafe low-level APIs and ad hoc encryption patterns.
* **Simplicity:** Clear interfaces and minimal options reduce room for error.
* **Performance:** Optimized for practical cryptographic operations.
* **Portability:** Suitable for use across mobile, browser, embedded, and server environments.

#### **Security Notes**

NaCl and TweetNaCl are widely used classical cryptographic libraries.

They are designed to be safer and harder to misuse than many low-level cryptographic APIs, but developers must still handle important security requirements correctly, including:

* Nonce uniqueness
* Secret key protection
* Signature verification failures
* Secure storage of private material

{% hint style="info" %}
**Note:** NaCl and TweetNaCl are classical cryptographic libraries and are not post-quantum secure. In Cryptic, they are used only where appropriate or during hybrid transition phases alongside post-quantum algorithms such as ML-KEM and ML-DSA.
{% endhint %}

**Further Reading**

* [NaCl Official Site](https://nacl.cr.yp.to/)
* [TweetNaCl GitHub](https://github.com/dchest/tweetnacl-js) (JS version)
* [Libsodium Docs](https://libsodium.gitbook.io/doc/)
* [Ed25519 Paper (Bernstein et al)](https://ed25519.cr.yp.to/ed25519-20110926.pdf)
* [Curve25519: New Diffie-Hellman Speed Record](https://cr.yp.to/ecdh/curve25519-20060209.pdf)
