crypto.createCipher and createDecipher have been removed
Removed. The source gives no day. Replacement: crypto.createCipheriv() and crypto.createDecipheriv(), with keys from crypto.scrypt() or crypto.pbkdf2() and random salts. Source: Node.js deprecations: DEP0106 crypto.createCipher.
Check a version:
evergreen check pkg:generic/nodejs
Node.js removed crypto.createCipher() and crypto.createDecipher() because they use a weak key derivation (MD5, no salt) and static IVs (DEP0106, end-of-life since v22.0.0).
Look up another package or runtime · <form action="../lookup.html" method="get" role="search"> </form>
| Status | Removed |
| Severity | high |
| Ecosystem | nodejs |
| Component | pkg:generic/nodejs |
| Affected versions | vers:semver/>=22.0.0 |
| Date from the source | The source gives no day |
| Replacement | crypto.createCipheriv() and crypto.createDecipheriv(), with keys from crypto.scrypt() or crypto.pbkdf2() and random salts |
| Evidence last seen | 2026-10-21 |
| Reviewed | 2026-10-21 by arminazimi |
| Review due | 2027-10-21 (365 days after the last review) |
| Rule ID | nodejs.symbol.crypto.createcipher |
Sources
- Node.js deprecations: DEP0106 crypto.createCipher (accessed 2026-10-21)
Migration
Constraints
- Keep the behavior of the call unchanged; check the replacement’s argument and error handling differences.
Steps
- Switch to the iv variants. Derive the key with crypto.scrypt and a random salt, generate a random IV, and call createCipheriv or createDecipheriv; existing ciphertext needs a decryption-then-reencrypt migration.
Verification
npm run test --if-present: Run the repository tests when defined.
Detected by
The npm detector. See Detectors and Compatibility.
Related
Other versions of this product
- Assert.CallTracker has been removed
- Async_hooks.currentId has been removed
- Async_hooks.triggerId has been removed
- The Buffer() constructor is deprecated
- The customFds option of child_process has been removed
- New crypto.Certificate() is deprecated
- Crypto.createCredentials has been removed
- Crypto.Credentials has been removed
- Crypto.DEFAULT_ENCODING has been removed
- Crypto.fips is deprecated
- The crypto.Hash constructor is deprecated
- The crypto.Hmac constructor is deprecated
Same ecosystem
- Node.js 18 is end-of-life
- Node.js 19 is end-of-life
- Node.js 20 is end-of-life
- Node.js 21 is end-of-life
- Node.js 22 reaches end-of-life on 2027-04-30
- Node.js 23 is end-of-life
- Node.js 25 is end-of-life
- Legacy Node.js runtime is end-of-life
Data
This page is generated from registry/nodejs.json, rule nodejs.symbol.crypto.createcipher, in the ebb.registry.v2 format (how rules are written). A CLE (ECMA-428) export is not published yet. The same facts are embedded in this page as schema.org structured data.
Last updated