出品者:Tia

A comprehensive JavaScript library providing AES, SHA, HMAC, PBKDF2, and other crypto standards for Node.js and browsers. Ideal for hashing, encryption, and API call signing in web and server applications.
This block provides a pure-JavaScript implementation of common cryptographic algorithms including AES, 3DES, Blowfish, RC4, Rabbit, and a full suite of hash and HMAC functions. It is aimed at Node.js, browser, and TypeScript projects that need symmetric encryption or message digests without depending on native bindings. Development of the upstream library has been discontinued; integrate with awareness that native crypto is preferred for new greenfield work.
core.js — CryptoJS namespace, WordArray, Base, BufferedBlockAlgorithm, Hex/Latin1/Utf8 encoders; the mandatory foundationcipher-core.js — Abstract Cipher, BlockCipher, StreamCipher, SerializableCipher, PasswordBasedCipher, and CipherParams typesaes.js — AES block cipher algorithm (CryptoJS.algo.AES)tripledes.js — Triple-DES block cipher algorithm (CryptoJS.algo.TripleDES)blowfish.js — Blowfish block cipher algorithm (CryptoJS.algo.Blowfish)rc4.js — RC4 stream cipherrabbit.js — Rabbit stream cipherrabbit-legacy.js — Rabbit with legacy IV handlingmd5.js — MD5 hashsha1.js — SHA-1 hashsha256.js — SHA-256 hashsha224.js — SHA-224 hashsha512.js — SHA-512 hashsha384.js — SHA-384 hashsha3.js — SHA-3 / Keccak hashripemd160.js — RIPEMD-160 hashhmac.js — HMAC construction used by all hmac-* helperspbkdf2.js — PBKDF2 key derivationevpkdf.js — OpenSSL EVP_BytesToKey KDF (used internally by password-based ciphers)enc-base64.js — Base64 encoder/decoderenc-base64url.js — Base64url encoder/decoderenc-utf16.js — UTF-16 encoder/decoderlib-typedarrays.js — support for /typed arrays隔離されたサンドボックスを起動しサーバー側で実行 — ローカル設定不要。
このバージョンの Tetrees AI Review
This JavaScript library / package completed archive review. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
パイプライン avcp-2026-08-04.1 · SHA-256 731fc7a84bf3b19e…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
レビュー日 2026年8月4日
この製品をお使いのAI IDE・Webビルダー・クラウドIDEに直接取り込みます。
Tetreesを対応AI IDEに接続し、所有製品の一覧取得と検証済みZIPの取得を、販売者のアップロード権限を公開せずに行えます。
まだレビューがありません。
Sign in to join the discussion
Loading discussion…
WordArray.initArrayBufferx64-core.js — 64-bit word and word array types for SHA-512/SHA-3format-hex.js — Hex CipherParams formattermode-cfb.js — CFB block cipher modemode-ctr.js — CTR block cipher modemode-ctr-gladman.js — CTR mode (Gladman variant)mode-ecb.js — ECB block cipher modemode-ofb.js — OFB block cipher modepad-ansix923.js — ANSI X.923 paddingpad-iso10126.js — ISO 10126 paddingpad-iso97971.js — ISO/IEC 9797-1 paddingpad-nopadding.js — No-op padding (stream-like)pad-zeropadding.js — Zero padding# No runtime npm dependencies — crypto-js is self-contained.
# For TypeScript type definitions:
npm install --save-dev @types/crypto-js
No native build steps, no pod install, no Android linking required. The library uses the platform's native crypto module (Node.js require('crypto') or window.crypto) only for CSPRNG; all algorithm logic is pure JS.
source/ directory into your project, e.g. src/vendor/crypto-js/.CryptoJS variable and are written as plain IIFE scripts. Load them in dependency order: core.js first, then any encoders/KDFs, then cipher infrastructure (cipher-core.js, mode files, padding files), then individual algorithms.npm install crypto-js
tsconfig.json:{
"compilerOptions": {
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
}
}
source/ files with webpack/Rollup, set up an alias so every algorithm can resolve core.js before it runs:// webpack.config.js
resolve: {
alias: {
'cryptojs-core': path.resolve(__dirname, 'src/vendor/crypto-js/core.js')
}
}
import AES from 'crypto-js/aes';
import Utf8 from 'crypto-js/enc-utf8'; // re-exported from core
// encrypt
const cipherParams: CryptoJS.lib.CipherParams =
AES.encrypt(message: string | WordArray, key: string | WordArray, cfg?: object): CryptoJS.lib.CipherParams;
// decrypt
const wordArray: CryptoJS.lib.WordArray =
AES.decrypt(ciphertext: string | CipherParams, key: string | WordArray, cfg?: object): CryptoJS.lib.WordArray;
Use when you need symmetric encryption. When key is a plain string the library derives the actual key and IV via EVP KDF internally. Pass a WordArray key + explicit iv in cfg when you control key material directly.
// Defined on any BlockCipher subclass (AES, TripleDES, Blowfish, …)
CryptoJS.algo.AES.createEncryptor(key: WordArray, cfg?: { iv?: WordArray; mode?: object; padding?: object }): Cipher;
CryptoJS.algo.AES.createDecryptor(key: WordArray, cfg?: { iv?: WordArray; mode?: object; padding?: object }): Cipher;
Use these when you need a low-level, stateful cipher instance — for example when encrypting a stream in chunks by calling .process(chunk) repeatedly and finalising with .finalize().
// Construction
CryptoJS.lib.WordArray.create(words?: number[], sigBytes?: number): WordArray;
// Encoding
wordArray.toString(encoder?: Encoder): string; // default: Hex
// Concatenation
wordArray.concat(other: WordArray): WordArray;
The internal binary representation used everywhere. Convert to/from Base64, Hex, or Utf8 via the encoders in enc-base64.js, core.js.
A quick encrypt/decrypt cycle using a string passphrase (EVP KDF key derivation). Suitable for non-critical storage; prefer explicit key + IV for production.
import CryptoJS from 'crypto-js';
const passphrase = 'super-secret-passphrase';
const plaintext = 'Hello, World!';
// Encrypt
const ciphertext: string = CryptoJS.AES.encrypt(plaintext, passphrase).toString();
console.log('Encrypted:', ciphertext);
// Decrypt
const bytes = CryptoJS.AES.decrypt(ciphertext, passphrase);
const recovered = bytes.toString(CryptoJS.enc.Utf8);
console.log('Decrypted:', recovered); // 'Hello, World!'
Use this when you supply your own key material (e.g. derived via PBKDF2 elsewhere).
import CryptoJS from 'crypto-js';
const key = CryptoJS.enc.Hex.parse('000102030405060708090a0b0c0d0e0f');
const iv = CryptoJS.enc.Hex.parse('101112131415161718191a1b1c1d1e1f');
const encrypted = CryptoJS.AES.encrypt('sensitive data', key, {
iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7,
});
const decrypted = CryptoJS.AES.decrypt(encrypted, key, {
iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7,
});
console.log(decrypted.toString(CryptoJS.enc.Utf8)); // 'sensitive data'
Sign an API request payload and encode the result as Base64 — a common pattern for webhook verification.
import hmacSHA256 from 'crypto-js/hmac-sha256';
import Base64 from 'crypto-js/enc-base64';
const privateKey = 'my-api-secret';
const payload = JSON.stringify({ event: 'charge.succeeded', id: 42 });
const signature = Base64.stringify(hmacSHA256(payload, privateKey));
console.log('X-Signature:', signature);
// Verify on the other end:
const expected = Base64.stringify(hmacSHA256(payload, privateKey));
const valid = signature === expected;
Derive a cryptographic key from a user password before using it with AES.
import CryptoJS from 'crypto-js';
const password = 'user-supplied-password';
const salt = CryptoJS.lib.WordArray.random(128 / 8);
const key256 = CryptoJS.PBKDF2(password, salt, {
keySize: 256 / 32,
iterations: 100000,
});
const iv = CryptoJS.lib.WordArray.random(128 / 8);
const ciphertext = CryptoJS.AES.encrypt('secret', key256, { iv }).toString();
console.log(ciphertext);
CryptoJS global, implements Base, WordArray, BufferedBlockAlgorithm, and the Hex/Latin1/Utf8 encoders. Must load before everything else.Cipher, BlockCipher, StreamCipher hierarchy plus SerializableCipher and PasswordBasedCipher (which wrap algorithms with Base64 serialisation and EVP KDF).BlockCipher; exposes CryptoJS.AES.CryptoJS.TripleDES and CryptoJS.DES.CryptoJS.Blowfish.CryptoJS.RC4 and CryptoJS.RC4Drop.Hasher.Hasher; used by the hmac-* entry points.EVP_BytesToKey used internally by PasswordBasedCipher..stringify(wordArray) and .parse(string).WordArray to accept ArrayBuffer and typed arrays in .create().X64Word and X64WordArray types needed by SHA-512 and SHA-3.CipherParams formatter that serialises ciphertext as hex instead of Base64.cfg.mode.cfg.padding.cipher-core.js reads CryptoJS.enc.Base64 and CryptoJS.algo.EvpKDF, so enc-base64.js and evpkdf.js must be loaded before it. Fix: always start with core.js → encoders → evpkdf.js → cipher-core.js → modes → pads → algorithms.WordArray key skips KDF entirely and uses the bytes directly. Fix: be explicit — always use CryptoJS.enc.Hex.parse(...) when you have raw key bytes.WordArray.toString() defaults to Hex: Calling .toString() without an encoder returns a hex string, not UTF-8. Fix: always pass CryptoJS.enc.Utf8 (or Base64) explicitly when recovering plaintext.crypto-js ships CJS modules; with "esModuleInterop": false the named import import CryptoJS from 'crypto-js' fails. Fix: set "esModuleInterop": true or use import * as CryptoJS from 'crypto-js'.lib-typedarrays.js not loaded: Passing an ArrayBuffer to WordArray.create() throws unless lib-typedarrays.js has been loaded. Fix: require('crypto-js/lib-typedarrays') before any code that converts typed arrays.mode-ctr.js (big-endian) and mode-ctr-gladman.js (little-endian) produce different ciphertexts for the same IV. Fix: pick one variant and use it consistently on both ends; default CryptoJS.mode.CTR is the big-endian version.I have dropped the crypto-js 4.2.0 source files into `src/vendor/crypto-js/`
in my project. I also have USAGE.md (the integration guide) open.
Please help me integrate crypto-js into my project step by step:
1. Read USAGE.md and the source files in `src/vendor/crypto-js/` to understand
the available algorithms and their real exports.
2. Install any missing dev dependencies (e.g. `@types/crypto-js`) and update
`tsconfig.json` so TypeScript resolves the module correctly.
3. Implement the following feature using the real API from the source:
[DESCRIBE YOUR USE CASE — e.g. "AES-CBC encryption of user data with a
PBKDF2-derived key, returning a Base64-encoded ciphertext string"]
4. Show the full import statements referencing `crypto-js` (or the vendor path),
the implementation, and a brief test that encrypts and then decrypts to
verify round-trip correctness.
5. Point out any loading-order or ESM/CJS interop issues specific to my
project setup and how to fix them.
Upstream package: user@example.com
Integration guide: USAGE.md
Source location: src/vendor/crypto-js/
CryptoJS is released under the MIT License. See source/LICENSE if present, or the npm package page for the full license text. Upstream repository: https://github.com/brix/crypto-js. Note that the upstream project is discontinued; consider migrating to the Node.js built-in crypto module or the Web Crypto API for new projects.
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
完全なインストールガイドと統合プロンプトは購入後に解放されます。
Automation, Utilities & Developer Tools
無料