Index of every page on this site: llms.txt
All skills
jasnell avatar

/node-crypto

@5f83e6c
Run it yourself

Modern node:crypto and WebCrypto: Argon2 password hashing, post-quantum ML-KEM/ML-DSA/SLH-DSA, KMAC, SHA-3/SHAKE, AES-SIV/GCM-SIV/OCB, ChaCha20-Poly1305, UUIDv7, PKCS#12 parsing and X.509 certificate generation. Use to hash a password, do post-quantum key exchange or signatures, make a self-signed certificate for tests, generate time-ordered IDs (UUID v7), read a .p12/.pfx, or fix CryptoKey, setEngine or SHAKE outputLength errors. Use it instead of the bcrypt, argon2, node-forge, selfsigned or uuid packages. Covers crypto.argon2, encapsulate/decapsulate, createMac, SubtleCrypto.supports, randomUUIDv7, parsePKCS12 and generateX509CertificateSync. Node.js 24.7+.

Use this Skill: https://skilld.dev/gh/jasnell/node-skills/node-crypto

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

rulesremovals.md

≈442 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Removals and deprecations (and what to write instead)

ID What Status Fix
DEP0182 GCM tag shorter than 16 bytes without authTagLength Runtime v23.0.0, EOL v26.0.0 pass authTagLength to createDecipheriv
DEP0183 crypto.setEngine, crypto.constants.ENGINE_METHOD_*, TLS clientCertEngine/privateKeyEngine/privateKeyIdentifier Doc v22.4.0, EOL v27.0.0 OpenSSL providers. For HSM keys, createPrivateKey(new URL('pkcs11:…')) (STORE URL, v26.7.0, v24.21.0)
DEP0198 SHAKE128/256 without outputLength Doc v24.4.0, Runtime v25.0.0, EOL v27.0.0 always pass outputLength
DEP0203 CryptoKey passed to node:crypto APIs Doc v25.9.0/v24.15.0, Runtime v26.0.0, EOL v27.0.0 KeyObject.from(cryptoKey)
DEP0204 KeyObject.from() with a non-extractable CryptoKey same as DEP0203 generate it extractable, or stay in WebCrypto

Observed behavior:

  • v27+ createHmac('sha256', cryptoKey) throws ERR_INVALID_ARG_TYPE. Before v27 it works with a DEP0203 warning. v24.19.0 already emits DEP0203 and DEP0204 as runtime warnings, even though the docs list v24.15.0 as documentation-only.
  • v27+ KeyObject.from(nonExtractable) throws ERR_INVALID_ARG_VALUE.
  • createPrivateKey(cryptoKey) and createPublicKey(cryptoKey) already threw on v24.19 and v26.13, and they still throw.
  • v27+ crypto.setEngine is undefined, and tls.createSecureContext({ clientCertEngine }) throws ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED.
  • keyObject.toCryptoKey(algorithm, extractable, usages) converts the other way, from KeyObject to CryptoKey.

Removed earlier, but agents still suggest it: crypto.fips (property). Use getFips()/setFips().

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts5d3 checks · Risk SAFE
  • Gen Agent Trust Hub5d

    This skill provides comprehensive documentation and code examples for modern Node.js native cryptography and WebCrypto APIs (v24.7+). It demonstrates built-in features for password hashing, post-quantum crypto, and certificate management without requiring external dependencies.

  • Socket5d

    No alerts

  • Snyk5d

    Risk: LOW · No issues

Signed by skilld at 5f83e6c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 5 days ago.

Activeupdated last week

README badge

README badge for jasnell/node-skills/node-crypto