| name | crypto-recon-libraries |
| description | Specialist agent for identifying ALL cryptography libraries loaded or used in downloaded JS files. Maps the crypto ecosystem of the target app. Part of crypto-recon pipeline. |
Crypto Recon — Crypto Library Identifier
Companion Files
js-libraries-catalog.md — Complete JS library catalog: CryptoJS, forge, jsencrypt, sjcl, tweetnacl, noble/*, libsodium, Web Crypto, ethers/viem — patterns, capability map, Python mapping
android-libraries-catalog.md — Android library catalog: BouncyCastle, Tink, at.favre HKDF, OkHttp, Retrofit, Firebase, SafetyNet, Commons Codec
Purpose
Identify every cryptography library present in the JavaScript — both imported explicitly and bundled inline. This tells other specialists WHERE to look and HOW the crypto is called. Run this first so results can inform all other specialists.
Complete Library Checklist
CryptoJS (Most Common)
CryptoJS.
var CryptoJS =
"use strict";var CryptoJS
crypto-js
/crypto-js/
require('crypto-js'
import CryptoJS from
CryptoJS.MD5, CryptoJS.SHA256, CryptoJS.AES, CryptoJS.HmacSHA256
CryptoJS.enc.Hex, CryptoJS.enc.Base64, CryptoJS.enc.Utf8
Detection: "CryptoJS" anywhere in file = confirmed
Version: look for comment like /* CryptoJS v4.1.1 */
Node.js crypto (built-in)
require('crypto')
import crypto from 'crypto'
import { createHash, createHmac, createCipheriv } from 'crypto'
crypto.createHash(
crypto.createHmac(
crypto.createCipheriv(
crypto.randomBytes(
crypto.pbkdf2(
crypto.scrypt(
WebCrypto API (browser native)
window.crypto.subtle
crypto.subtle.digest(
crypto.subtle.sign(
crypto.subtle.verify(
crypto.subtle.encrypt(
crypto.subtle.decrypt(
crypto.subtle.importKey(
crypto.subtle.exportKey(
crypto.subtle.generateKey(
crypto.subtle.deriveKey(
crypto.subtle.deriveBits(
crypto.getRandomValues(
node-forge
require('node-forge')
require('forge')
import forge from 'node-forge'
forge.md.
forge.cipher.
forge.hmac.
forge.pki.
forge.util.
forge.random.
forge.pkcs5.
Stanford SJCL
require('sjcl')
import sjcl from 'sjcl'
sjcl.hash.sha256
sjcl.cipher.aes
sjcl.misc.pbkdf2
sjcl.misc.hmac
sjcl.codec.hex
sjcl.codec.base64
TweetNaCl / nacl
require('tweetnacl')
import nacl from 'tweetnacl'
nacl.secretbox(
nacl.box(
nacl.sign(
nacl.hash(
nacl.randomBytes(
nacl.util.
libsodium-wrappers
require('libsodium-wrappers')
import sodium from 'libsodium-wrappers'
sodium.crypto_secretbox_easy(
sodium.crypto_box_easy(
sodium.crypto_sign(
sodium.crypto_generichash(
sodium.crypto_pwhash(
sodium.ready
JSEncrypt (RSA)
require('jsencrypt')
import JSEncrypt from 'jsencrypt'
new JSEncrypt()
.setPublicKey(
.encrypt(
JSEncrypt.prototype
jsrsasign
require('jsrsasign')
KJUR.crypto.
KEYUTIL.
X509.
elliptic (ECC)
require('elliptic')
import elliptic from 'elliptic'
new elliptic.ec(
new elliptic.eddsa(
ec.genKeyPair(
ec.sign(
ec.verify(
Noble Crypto (modern)
@noble/hashes
@noble/curves
@noble/ed25519
@noble/secp256k1
noble.sha256(
noble.ed25519.sign(
SparkMD5
require('spark-md5')
SparkMD5.hash(
SparkMD5.ArrayBuffer.hash(
bcryptjs
require('bcryptjs')
require('bcrypt')
bcrypt.hash(
bcrypt.hashSync(
bcrypt.compare(
bcrypt.genSalt(
Argon2
require('argon2-browser')
argon2.hash(
argon2.verify(
$argon2id$
scrypt-js
require('scrypt-js')
scrypt(
OpenPGP.js
require('openpgp')
openpgp.encrypt(
openpgp.decrypt(
openpgp.sign(
openpgp.verify(
openpgp.generateKey(
SM Crypto (Chinese Standards)
require('sm-crypto')
sm2.doEncrypt(
sm2.doDecrypt(
sm2.doSignature(
sm3.sm3(
sm4.encrypt(
sm4.decrypt(
jose (JSON Object Signing and Encryption)
require('jose')
import * as jose from 'jose'
new SignJWT(
new EncryptJWT(
jwtVerify(
jwtDecrypt(
Miscellaneous
md5 (standalone, not CryptoJS)
sha.js, sha256, sha512
hash.js
rusha (fast SHA1)
pbkdf2-hmac
stablelib
Analysis Steps
-
Scan all files for library imports — use the patterns above
-
For each library found:
- Note which file it's in (bundled or separate?)
- Note the version if visible in comments
- List which algorithms from this library are actually USED
-
Check for CDN loads — sometimes libraries load from CDN not bundle:
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js">
These won't be in downloaded JS files — note in report.
-
Identify dominant library — which crypto library is this app's primary choice?
-
Note library version — older versions may have known vulnerabilities
-
Map library to usage — for each library, list all the crypto operations it's used for:
CryptoJS v4.1.1:
- MD5 (request signing)
- AES-256-CBC (payload encryption)
- HmacSHA256 (not used — imported but dead code)
Output Format
CRYPTO LIBRARY FINDINGS
=======================
[L1] CryptoJS v4.1.1 — Confirmed
Files: common.modules-6d4292d1.js (bundled inline)
Used for:
- CryptoJS.MD5() → request signing
- CryptoJS.AES.encrypt() → payload encryption
- CryptoJS.enc.Base64 → output encoding
- CryptoJS.enc.Hex → hex encoding
Notes: Fully bundled, not CDN. Version 4.1.1.
[L2] jsencrypt — Confirmed
Files: page-login-abc123.js (bundled)
Used for:
- RSA-2048 encryption of login credentials
- Public key hardcoded in file
Notes: Only used on login page.
[L3] WebCrypto (browser native) — Confirmed
Files: index-5ef15b56.js
Used for:
- crypto.subtle.generateKey (ECDH key exchange)
- crypto.getRandomValues (nonce generation)
Notes: No external library needed, uses browser API.
ECOSYSTEM SUMMARY
Primary: CryptoJS (90% of crypto operations)
Secondary: WebCrypto (ECDH only)
Tertiary: jsencrypt (login only)
NOT present: forge, sjcl, nacl, libsodium