# libsodium.js: 7.4 out of 10

A strong pick. 4th of 10 in [Cryptography and password hashing](https://elestia.ai/opensource/crypto/index.md).

libsodium.js is the well-known libsodium C library compiled to WebAssembly, with JavaScript wrappers. It gives one API for authenticated encryption, signatures, key exchange and password hashing in browsers, Node.js and Bun. It is a strong, actively maintained choice when you want libsodium's full, misuse-resistant toolkit. The trade-offs are a large bundle, async setup, and password hashing that only the sumo build includes.

**Best for:** Teams that want libsodium's complete, audited primitives (secretbox, box, sign, secretstream, Argon2) with the same API in browsers and on servers.

## Scores

- **Overall: 7.4** (likely 6.3 to 8.1)
  - Claude Opus 5.5 (7.0): It is a strong pick when you need libsodium's full toolkit in JavaScript, especially across browser and server. It is actively maintained and has a clean security record. Noble packages suit most new projects better when they need only a few primitives and want a small, synchronous, tree-shakeable bundle. node-argon2 or bcrypt is simpler for server-side password hashing alone. The large bundle and the sumo-only Argon2 keep it below the top tier.
  - GPT-6.2 Sol (7.8): Choose libsodium.js for a new project that needs Sodium-compatible encryption and signing across browsers and servers. For a Node.js service whose only requirement is password storage, node-argon2 offers a simpler hash and verify API. Ongoing development supports the recommendation, while the browser payload, concentration of releases under one signer, and limited evidence on current-build performance keep the range wide.
- **Needed by many: 5.2** (likely 4.1 to 6.3)
  - Claude Opus 5.5 (5.0): Encryption, signing and password hashing are needed in many apps, but most web developers reach for platform crypto or bcrypt/argon2 for one task. libsodium.js serves the narrower group that needs a general crypto toolkit, especially one that also runs in the browser. Password hashing in the standard package is missing, which narrows it a little.
  - GPT-6.2 Sol (5.4): Password storage, signing, and encryption matter to many applications, and the wrappers work across browsers and servers. Built-in crypto covers common operations, so a separate Sodium dependency mainly serves teams that need its algorithms or formats. Browser measurements give some context, but they leave server-side demand and the share of developers who need Sodium uncertain.
- **Helps a lot: 7.6** (likely 6.5 to 8.5)
  - Claude Opus 5.5 (7.0): The API is the most complete in the category, and it is built on libsodium's misuse-resistant design and constant-time helpers. Version 0.8 added generated TypeScript types and ESM. Limits keep the score from going higher: a large WASM bundle, the async ready step, functions that are not named exports, slower symmetric encryption than WebCrypto in CryptPad's benchmarks, and Argon2 only in sumo. Several 0.8 regressions came out in early 2026 and were fixed quickly.
  - GPT-6.2 Sol (8.1): Version 0.8.4 covers authenticated encryption, streaming, signing, and Argon2id through sumo. Bundled types and examples help callers choose the right methods, though they still need to await initialization and select the right build. CryptPad’s older browser tests found competitive public-key encryption and faster native Web Crypto on several other operations. Current performance across runtimes and coding-agent accuracy remain uncertain.
- **Holds up over time: 7.1** (likely 5.9 to 8.2)
  - Claude Opus 5.5 (7.0): The project is very active, with 155 commits and 6 releases last year and zero open issues or pull requests. It follows the upstream libsodium closely, and that maintainer has kept it going for more than ten years. The risks are that the work rests largely on one maintainer, and the 0.7 to 0.8 move caused some churn.
  - GPT-6.2 Sol (7.1): The repository recorded 155 commits and six releases in a year, with commits continuing into October after the April release. One person signed the recent releases, and the public record gives little evidence of backup release ownership or sustained funding. A downstream Next.js user reported a broken sumo import in 0.7.16 and found that upgrading to 0.8.0 restored the build.
- **Used widely: 5.1** (likely 4.0 to 6.2)
  - Claude Opus 5.5 (5.5): Downloads were 29.8M in the last 4 weeks, against 5.2M a year ago. That ratio of 5.7 is above the 4.1 median, so the project is gaining ground. Many of the installs are likely transitive, through SDKs that encrypt secrets or handle voice and blockchain work. Its 6,558 dependent repos match node-argon2 but are well below noble, TweetNaCl and bcrypt.
  - GPT-6.2 Sol (4.6): Four-week downloads rose from 5.21 million to 29.83 million, about 5.7× against the 4.1× catalog baseline. The 6,558 tracked dependent repositories and 489 packages put the standard wrapper close to node-argon2 and hash-wasm and far behind TweetNaCl.js and Forge. Repeat and transitive installs inflate downloads, and the tracked counts leave out separate sumo and script-tag use.
- **Vouched for: 6.4** (likely 4.9 to 7.5)
  - Claude Opus 5.5 (6.0): libsodium itself is an industry standard. The JS port had a 2017 audit, paid for by Private Internet Access. Independent reviews such as CryptPad's treat it as a serious option, and many SDKs build on it. There are few current, independent write-ups or survey numbers specific to the JS wrapper, and the audit is old.
  - GPT-6.2 Sol (6.7): Microsoft’s VS Code remote package declares the current wrapper, and discord.js Voice documents it as an optional encryption provider. Least Authority recommended the WebAssembly build in a 2021 wallet review, and CryptPad published mixed browser benchmarks in 2023. Those evaluations predate 0.8.4, which limits how much they say about the current build.
- **Safe: 6.9** (likely 5.7 to 8.0)
  - Claude Opus 5.5 (7.0): It has no known advisories, only one dependency (its own libsodium core), and an ISC licence. The Scorecard is 4.5: it has no code review, no branch protection, no security policy and unpinned dependencies, and one person does the releases. The WASM build comes from heavily scrutinised C code, which lowers the risk of the cryptography itself.
  - GPT-6.2 Sol (6.7): The wrapper has a permissive ISC license and one runtime dependency, and the supplied OSV snapshot lists zero wrapper advisories. The 0.8 release line incorporated upstream security fixes, and GitHub verifies the 0.8.4 source tag. Scorecard rates the repository 4.5 out of 10, with weak code review, branch protection, and dependency pinning. The tagged release script publishes directly with npm or Yarn, leaving build provenance uncertain.

## Good

- It covers far more than TweetNaCl: XChaCha20 secretstream, KDFs, generic hashing and (in sumo) Argon2id, all under one API.
- It is built from libsodium itself, a widely trusted C library, and stays current with upstream (1.0.22 in 0.8.3).
- Since 0.8.1 it ships its own TypeScript types and ESM builds, so @types/libsodium-wrappers is no longer needed.
- It has a single runtime dependency, no known advisories, and an issue tracker with nothing left open.

## Bad

- The bundle is large, at about 290 KB gzipped for the standard build and 375 KB for sumo, compared with a few KB for noble or TweetNaCl.
- crypto_pwhash (Argon2) exists only in the sumo build, so the standard libsodium-wrappers package cannot hash passwords.
- You must await sodium.ready before any call, and crypto functions are not named ESM exports, which trips up bundlers and AI-written code.
- The move to 0.8 brought several ESM, packaging and performance regressions, and one person does nearly all of the releases.

## The numbers

- Downloads, 4 weeks: 30M
- In a year: ×5.7
- GitHub stars: 1.2k
- Commits, 12 months: 155
- Last npm release: Apr 2026
- Advisories, 24 months: 0
- Licence: ISC
- GitHub: https://github.com/jedisct1/libsodium.js
- npm: https://www.npmjs.com/package/libsodium-wrappers

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
