JavaScript library of crypto standards providing various cryptographic algorithms including AES, DES, SHA-256, MD5, HMAC, and PBKDF2. Version 4.2.0 is the latest stable release, but the library is discontinued and no longer maintained. It supports both Node.js and browser environments with modular imports. The library uses the native Crypto module for random number generation but relies on its own implementations for other operations. Development has stopped; users are encouraged to migrate to the native Web Crypto API in modern browsers or Node.js crypto module. Release cadence has been low, with the last release in 2021.
npm install crypto-jsVerified import paths — ran on the pinned version, not inferred.
Demonstrates SHA-256 hashing, AES encryption and decryption with a string key, and hex encoding.
Migrate to native Web Crypto API in browsers or Node.js crypto module.
Provide a proper IV: CryptoJS.AES.encrypt(msg, key, { iv: CryptoJS.lib.WordArray.random(16) }).toString()Use hash.toString(CryptoJS.enc.Hex) or other explicit encoder.
Always use CryptoJS.lib.WordArray.random() for secure keys.
Install via npm instead: npm install crypto-js
Import full library: import CryptoJS from 'crypto-js'; then use CryptoJS.enc.Utf8.
Explicitly import the encoder: import encHex from 'crypto-js/enc-hex';
Update browser or use a polyfill.
Ensure the module is installed: npm install crypto-js. For browser, include via script tag: <script src='path/to/crypto-js/crypto-js.js'></script>
No dependency data recorded yet.