gitmyhub

sjcl

JavaScript ★ 7.2k updated 3mo ago

[DEPRECATED] Stanford Javascript Crypto Library

A deprecated JavaScript cryptography library originally built at Stanford University for in-browser encryption and key generation, upgrade existing installs to version 1.0.9 to patch a critical ECDH private-key vulnerability, then migrate to a modern alternative.

JavaScriptsetup: easycomplexity 2/5

SJCL stands for Stanford Javascript Crypto Library. It is a JavaScript library that was originally built at Stanford University to provide cryptographic tools you can use directly in a web browser or JavaScript application. Cryptography here means things like encrypting data, generating secure keys, and performing mathematical operations that keep information private.

The library is officially deprecated, meaning the authors have stopped maintaining it and do not recommend using it in new projects. The README is explicit: if you are starting something new, look elsewhere for a more modern alternative. The only reason the project still exists on GitHub is historical reference and to distribute a final security fix.

That security fix matters. A researcher discovered a serious vulnerability in the part of the library that handles a key-exchange method called ECDH. An attacker who could send specially crafted inputs to your application could potentially recover your private key, which would break the confidentiality of anything protected by it. This flaw was patched in version 1.0.9, which is the last release. If you are running any older version of SJCL in an existing application, upgrading to 1.0.9 is the only safe course of action.

Past versions of the library also changed how a base-32 text encoding worked in version 1.0.4. The encoding alphabet was updated to match a formal standard, and data encoded with the old format needs to be decoded with a different codec name going forward. These details matter only if you have existing data produced by older versions.

In short, SJCL is a closed chapter. It served as a usable in-browser cryptography option before the modern Web Crypto API was widely available, but that era has passed. The repository stays up so existing users can access the final patched release and understand the history of changes.

Where it fits