> 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)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cryptic-documentation.gitbook.io/cryptic-documentation/technology/2.-technology-overview/2.1-platform-architecture/tweetnacl.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
