crypto-js

A JavaScript library of crypto standards - hashing, HMAC, PBKDF2, and symmetric ciphers for Node.js and the browser.

Library
npm
v4.2.0
16,398 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
44 /100 Fair
Development Activity 0
Maintenance 0
Community 76
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
69 /100 Good
Architecture 72
Code Quality 68
Innovation 71
Learning Curve 78

CryptoJS is a widely used JavaScript library that implements a broad set of cryptographic standards in pure JavaScript, so the same code runs in Node.js and the browser without native bindings. It provides hashers (MD5, SHA-1, SHA-2, SHA-3, RIPEMD-160), HMAC, the PBKDF2 key-derivation function, and symmetric ciphers including AES, TripleDES, Rabbit, and RC4, along with a rich set of encoders, block-cipher modes, and padding schemes.

Its modular design lets you import only the algorithms you need (for example crypto-js/sha256 or crypto-js/aes) to keep bundles small, or pull in the full CryptoJS object for access to every primitive. Note that active development has been discontinued in favor of the platform-native Crypto module, but the library remains extremely popular for API signing, password hashing, and interoperable AES encryption.

What You Get

  • Hash functions: MD5, SHA-1, SHA-224/256/384/512, SHA-3, and RIPEMD-160
  • HMAC variants for every supported hash and the PBKDF2 key-derivation function
  • Symmetric ciphers: AES, TripleDES, Rabbit, RC4, and Blowfish with OpenSSL-compatible formatting
  • Configurable block-cipher modes (CBC, CFB, CTR, OFB, ECB) and padding schemes (PKCS7, ANSI X.923, ISO-10126, zero, no-padding)
  • Encoders for Latin1, UTF-8, UTF-16, Hex, Base64, and URL-safe Base64

Common Use Cases

  • Signing API requests by hashing and HMAC-signing payloads on the client
  • Encrypting and decrypting data with AES that interoperates with OpenSSL and other implementations
  • Deriving keys from passwords using PBKDF2 before encryption or storage

Under The Hood

Architecture

CryptoJS is organized as a single global CryptoJS object progressively extended by self-invoking modules. The foundation in src/core.js defines CryptoJS.lib (Base, WordArray, BufferedBlockAlgorithm, Hasher) and CryptoJS.enc, where WordArray - an array of 32-bit words plus a byte length - is the universal data type passed between every primitive. Algorithm modules such as src/sha256.js and src/aes.js register themselves onto CryptoJS.algo and expose convenience wrappers (e.g. CryptoJS.SHA256, CryptoJS.AES.encrypt); block ciphers layer through cipher-core.js, which supplies mode (mode-cbc) and padding (pad-pkcs7) strategies and the OpenSSL-compatible key-derivation/serialization format.

Tech Stack

The library is written in pure ES5 JavaScript with zero runtime dependencies, deliberately avoiding native bindings so identical code runs in Node.js, browsers, and web workers; the only platform touch point is core.js detecting a native crypto object for cryptographically secure random numbers. Builds are driven by Grunt (Gruntfile.js, grunt/) with JSHint linting configured via .jshintrc, and modules are authored as UMD-style IIFEs so both CommonJS require and AMD/RequireJS consumers work.

Code Quality

The repository carries a substantial test suite - roughly 66 files under test/ (e.g. aes-test.js, sha256-test.js, hmac-md5-test.js) exercising standard test vectors for each algorithm - giving good confidence in correctness against known-answer values. The code is mature and stable but shows its age: ES5 var declarations, no TypeScript types shipped in-tree, and terse single-letter shortcuts (C, C_lib, C_algo) that favor brevity over readability.

API Design

The public API is compact and ergonomic: hashing is a one-liner (CryptoJS.SHA256('message')), AES encryption returns a chainable CipherParams whose toString() yields OpenSSL-formatted ciphertext, and modular paths like crypto-js/sha256 keep bundles small. The main friction is stringly-typed configuration (passing a passphrase string vs. a WordArray key silently changes behavior) and reliance on external GitBook documentation rather than rich in-repo API docs, which can surprise newcomers around key handling.

Used by 40 apps in this directory

Vue
50%
GPL 3.0

IT-Tools

Developer Tools

40,954

A unified collection of 88 web-based developer utilities — from JSON formatting to subnet calculation — all self-hostable, keyboard-searchable, and offline-ready.

View details
60
Repo Health
74
Technical
63
Dependency
Built with
Vue 50%
TypeScript 48%
Updated 1 weeks ago
Python
55%
MIT

LibrePhotos

File Storage

8,111

Self-hosted photo library with AI-powered face recognition, semantic search, and automatic event albums — no cloud required.

View details
84
Repo Health
78
Technical
66
Dependency
Built with
Python 55%
TypeScript 43%
Updated 6 days ago
TypeScript
98%
Other

LobeHub

AI Assistants · Automation · Productivity

83,455

Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.

View details
92
Repo Health
81
Technical
65
Dependency
Built with
TypeScript 98%
Updated 6 days ago
JavaScript
55%
Other

Lokus

Knowledge Management · Note Taking

829

Local-first note-taking with graph view, canvas & AI plugins—your Markdown files, zero telemetry, blazing-fast Rust performance.

View details
75
Repo Health
75
Technical
64
Dependency
Built with
JavaScript 55%
HTML 21%
Rust 12%
Updated 2 months ago
TypeScript
44%
Other

Magic

AI Agents · Automation · Low Code Platforms

5,055

Magic is an enterprise-grade open-source AI agent platform combining a generalist AI agent, workflow engine, IM, and collaborative office system for running an AI-powered digital workforce.

View details
68
Repo Health
79
Technical
65
Dependency
Built with
TypeScript 44%
PHP 32%
Updated 2 months ago
TypeScript
81%
AGPL 3.0

massCode

Code Editors · Developer Tools · Productivity

7,085

A free, local-first developer workspace unifying snippets, notes, HTTP requests, calculations, drawings, and dev tools in one desktop app.

View details
85
Repo Health
87
Technical
62
Dependency
Built with
TypeScript 81%
Vue 17%
Updated 2 weeks ago
JavaScript
94%
AGPL 3.0

MyApi

AI Agents

23

A privacy-first personal API gateway for AI agents — connect your services once, issue scoped tokens to agents like OpenClaw, Hermes, or Claude Code, and keep a full audit trail instead of scattering raw credentials across .env files.

View details
37
Repo Health
64
Technical
73
Dependency
Built with
JavaScript 94%
Updated 3 weeks ago
TypeScript
65%
Other

NocoDB

Databases · Low Code Platforms · No Code Platforms

65,340

Turn any SQL database into a collaborative no-code spreadsheet with automatic REST APIs and real-time views.

View details
91
Repo Health
77
Technical
63
Dependency
Built with
TypeScript 65%
Vue 30%
Updated 6 days ago
TypeScript
89%
GPL 3.0

NoteGen

AI Assistants · Knowledge Management · Note Taking

12,914

Capture anything first, then let AI transform your scattered records into polished, structured Markdown notes with RAG-powered knowledge retrieval.

View details
87
Repo Health
74
Technical
67
Dependency
Built with
TypeScript 89%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers