npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eslint-plugin-crypto

v2.1.1

Published

Security-focused ESLint plugin with 24 AI-parseable rules for cryptographic best practices. Detects weak algorithms, insecure key handling, CVE-specific vulnerabilities, and deprecated crypto patterns.

Readme

Description

This plugin enforces cryptographic best practices and modern security standards specifically for Node.js environments. It assists developers in avoiding weak algorithms and insecure implementations by flagging potential risks directly in the code. By integrating these checks, you can ensure that your application's data protection measures are robust and compliant with industry standards.

Philosophy

Interlace fosters strength through integration. Instead of stacking isolated rules, we interlace security directly into your workflow to create a resilient fabric of code. We believe tools should guide rather than gatekeep, providing educational feedback that strengthens the developer with every interaction.

Getting Started

npm install eslint-plugin-crypto --save-dev

💡 What You Get

  • 24 security rules covering cryptographic best practices
  • CVE detection for CVE-2023-46809, CVE-2020-36732, CVE-2023-46233
  • OWASP Top 10 coverage for cryptographic vulnerabilities
  • LLM-optimized messages with CWE references and fix guidance
  • Package support for crypto-hash, crypto-random-string, crypto-js

Features

  • 🔐 24 Rules covering crypto best practices
  • 🎯 CVE Detection (CVE-2023-46809, CVE-2020-36732, CVE-2023-46233)
  • 🤖 AI-Optimized messages with CWE references
  • Auto-Fix suggestions where safe
  • 📦 Package Support for crypto-hash, crypto-random-string, crypto-js

⚙️ Configuration Presets

| Preset | Description | | :------------------- | :------------------------------------------- | | recommended | Balanced security defaults for most projects | | strict | Strict preset - all rules as errors | | cryptojs-migration | For teams migrating from crypto-js | | nodejs-only | Only Node.js crypto rules | | cve-focused | Rules targeting specific CVEs |

📚 Supported Libraries

| Library | npm | Downloads | Detection | | ------------------ | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | --------------------------------- | | crypto (Node.js) | node | - | Weak Algo, Key Length, Randomness | | crypto-js | npm | downloads | Legacy patterns, Weak PRNG |

Examples

❌ Bad

// CVE-2023-46809: Marvin Attack
crypto.privateDecrypt({ key, padding: crypto.constants.RSA_PKCS1_PADDING }, buffer);

// CWE-338: Weak random
const token = Math.random().toString(36);

// CWE-327: ECB mode leaks patterns
crypto.createCipheriv('aes-256-ecb', key, iv);

// CWE-208: Timing attack
if (userToken === storedToken) { ... }

✅ Good

// Use OAEP padding
crypto.privateDecrypt({ key, padding: crypto.constants.RSA_PKCS1_OAEP_PADDING }, buffer);

// Secure random
const token = crypto.randomBytes(32).toString('hex');

// GCM provides authentication
crypto.createCipheriv('aes-256-gcm', key, iv);

// Constant-time comparison
if (crypto.timingSafeEqual(Buffer.from(userToken), Buffer.from(storedToken))) { ... }

Peer Dependencies (Optional)

{
  "crypto-hash": ">=3.0.0",
  "crypto-random-string": ">=4.0.0",
  "crypto-js": ">=4.0.0"
}

AI-Optimized Messages

This plugin is optimized for ESLint's Model Context Protocol (MCP), enabling AI assistants like Cursor, GitHub Copilot, and Claude to:

  • Understand the exact vulnerability type via CWE references
  • Apply the correct fix using structured guidance
  • Provide educational context to developers
// .cursor/mcp.json
{
  "mcpServers": {
    "eslint": {
      "command": "npx",
      "args": ["@eslint/mcp@latest"]
    }
  }
}

By providing this structured context (CWE, OWASP, Fix), we enable AI tools to reason about the security flaw rather than hallucinating. This allows Copilot/Cursor to suggest the exact correct fix immediately.

Rules

Legend

| Icon | Description | | :--: | :----------------------------------------------------------------- | | 💼 | Recommended: Included in the recommended preset. | | ⚠️ | Warns: Set towarn in recommended preset. | | 🔧 | Auto-fixable: Automatically fixable by the --fix CLI option. | | 💡 | Suggestions: Providing code suggestions in IDE. | | 🚫 | Deprecated: This rule is deprecated. |

| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 | 🚫 | | :-------------------------------------------------------------------------------------------------------------------- | :-----: | :------: | :--: | :--------------------------------------------------------------------------------- | :-: | :-: | :-: | :-: | :-: | | no-weak-hash-algorithm | CWE-327 | A02:2025 | 7.5 | no-weak-hash-algorithm | 💼 | | | 💡 | | | no-weak-cipher-algorithm | CWE-327 | A02:2025 | 7.5 | no-weak-cipher-algorithm | 💼 | | | 💡 | | | no-deprecated-cipher-method | CWE-327 | A02:2025 | 5.0 | no-deprecated-cipher-method | 💼 | | | 💡 | | | no-static-iv | CWE-329 | A02:2025 | 7.5 | no-static-iv | 💼 | | | 💡 | | | no-ecb-mode | CWE-327 | A02:2025 | 7.5 | no-ecb-mode | 💼 | | | 💡 | | | no-insecure-key-derivation | CWE-916 | A02:2025 | 7.5 | no-insecure-key-derivation | 💼 | | | 💡 | | | no-hardcoded-crypto-key | CWE-321 | A02:2025 | 9.8 | no-hardcoded-crypto-key | 💼 | | | 💡 | | | require-random-iv | CWE-329 | A02:2025 | 7.5 | require-random-iv | 💼 | ⚠️ | | 💡 | | | no-insecure-rsa-padding | CWE-327 | A02:2025 | 7.4 | no-insecure-rsa-padding | 💼 | | | 💡 | | | no-cryptojs-weak-random | CWE-338 | A02:2025 | 5.3 | no-cryptojs-weak-random | 💼 | | | 💡 | | | require-secure-pbkdf2-digest | CWE-916 | A02:2025 | 9.1 | require-secure-pbkdf2-digest | 💼 | | | 💡 | | | no-math-random-crypto | CWE-338 | A07:2025 | 5.3 | no-math-random-crypto | 💼 | | | 💡 | | | no-predictable-salt | CWE-331 | A07:2025 | 7.5 | no-predictable-salt | 💼 | | | 💡 | | | require-authenticated-encryption | CWE-327 | A04:2025 | 6.5 | require-authenticated-encryption | 💼 | ⚠️ | | 💡 | | | no-key-reuse | CWE-323 | A02:2025 | 7.5 | no-key-reuse | 💼 | ⚠️ | | 💡 | | | no-self-signed-certs | CWE-295 | A05:2025 | 7.5 | no-self-signed-certs | 💼 | | | 💡 | | | no-timing-unsafe-compare | CWE-208 | A02:2025 | 5.9 | no-timing-unsafe-compare | 💼 | ⚠️ | | 💡 | | | require-key-length | CWE-326 | A02:2025 | 7.5 | require-key-length | 💼 | ⚠️ | | 💡 | | | no-web-crypto-export | CWE-321 | A02:2025 | 5.0 | no-web-crypto-export | 💼 | ⚠️ | | 💡 | | | no-sha1-hash | CWE-327 | A02:2025 | 7.5 | no-sha1-hash | 💼 | | | 💡 | | | require-sufficient-length | CWE-326 | A02:2025 | 7.5 | require-sufficient-length | 💼 | ⚠️ | | 💡 | | | no-numeric-only-tokens | CWE-330 | A07:2025 | 5.3 | no-numeric-only-tokens | 💼 | ⚠️ | | 💡 | | | no-cryptojs | CWE-327 | A02:2025 | 5.0 | no-cryptojs | 💼 | ⚠️ | | 💡 | | | prefer-native-crypto | CWE-327 | A05:2025 | 5.0 | prefer-native-crypto | 💼 | ⚠️ | | 💡 | |

🔗 Related ESLint Plugins

Part of the Interlace ESLint Ecosystem — AI-native security plugins with LLM-optimized error messages:

| Plugin | Downloads | Description | | :--------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------ | | eslint-plugin-secure-coding | downloads | General security rules & OWASP guidelines. | | eslint-plugin-pg | downloads | PostgreSQL security & best practices. | | eslint-plugin-jwt | downloads | JWT security & best practices. | | eslint-plugin-browser-security | downloads | Browser-specific security & XSS prevention. | | eslint-plugin-vercel-ai-security | downloads | Vercel AI SDK security rules. | | eslint-plugin-express-security | downloads | Express.js security hardening rules. | | eslint-plugin-lambda-security | downloads | AWS Lambda security best practices. | | eslint-plugin-nestjs-security | downloads | NestJS security rules & patterns. | | eslint-plugin-import-next | downloads | Next-gen import sorting & architecture. |

📄 License

MIT © Ofri Peretz