# dchest/tweetnacl-js

Port of TweetNaCl cryptographic library to JavaScript

Repository: https://github.com/dchest/tweetnacl-js
Canonical: https://ross.abutalabs.com/products/tweetnacl-js
Homepage: https://tweetnacl.js.org
Language: JavaScript
License: Unlicense
License Family: permissive
Topics: crypto, javascript, authentication, signature, elliptic-curves, secretbox, djb, salsa20, curve25519, eddsa, sha-512, tweetnacl, nacl, libsodium, ed25519
Last push: 2025-08-15T11:43:43+00:00

## Health v2 (maintenance only)
Score: 39/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 37, release rhythm 8, longevity 100
- inputs: {"age_days": 4623, "days_push": 383, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1921, forks 296 (observed 2026-08-28T04:05:55.249227+00:00)

## What it is
TweetNaCl.js is a JavaScript port of the TweetNaCl/NaCl cryptographic library, providing high-level APIs for secret-key and public-key authenticated encryption, Ed25519 signatures, SHA-512 hashing, and random byte generation in a compact 7 KB package. It works in modern browsers and Node.js, is public domain, and has been security-audited by Cure53.

## Use cases
- encrypt and decrypt messages with a shared secret key in JavaScript
- implement public-key authenticated encryption with Curve25519 in the browser
- sign and verify messages with Ed25519 signatures in Node.js
- hash data with SHA-512 in a web app
- generate cryptographically secure random bytes in JavaScript
- perform constant-time comparison of secrets to avoid timing attacks
- add compact crypto to a browser extension or client-side app

## When to choose
- you need a small, audited, dependency-free crypto library for browser or Node.js
- you need NaCl-compatible primitives like secretbox, box, or Ed25519 in JavaScript
- you want a public-domain license with no licensing restrictions
- you need a faithful port of TweetNaCl with a thin idiomatic API

## When to avoid
- you can use the WebCrypto API, which covers X25519, Ed25519, and SHA-512 natively
- you need a full security protocol or key-committing encryption, since this is a low-level primitive library
- you need XSalsa20-Poly1305 with post-quantum or key-commitment guarantees
- you need high-performance crypto where native implementations are available

## Facets
- artifact type: library
- maturity: stable
- function: cryptography, auth, serialization
- domain: security, developer-tools, web-development
- platform: browser, cross-platform
- tags: tweetnacl, nacl, libsodium, ed25519, curve25519, salsa20, poly1305, sha-512, secretbox, public-key-cryptography, authenticated-encryption, signatures, audited, javascript, nodejs

## Member repositories
- dchest/tweetnacl-js (main) score 39

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:55.249227+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:09:41.872634+00:00, confidence not recorded.
  - readme: https://github.com/dchest/tweetnacl-js (fetched 2026-08-28T04:05:55.249227+00:00, sha 7928051fb8f7)
  - homepage: https://tweetnacl.js.org (fetched 2026-08-29T10:49:21.740917+00:00, sha c29b136474e8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
