feat(DEP0106): migrate from crypto.createCipher & crypto.createDecipher#265
Open
AugustinMauroy wants to merge 10 commits intomainfrom
Open
feat(DEP0106): migrate from crypto.createCipher & crypto.createDecipher#265AugustinMauroy wants to merge 10 commits intomainfrom
crypto.createCipher & crypto.createDecipher#265AugustinMauroy wants to merge 10 commits intomainfrom
Conversation
avivkeller
reviewed
Dec 18, 2025
crypto-createcipheriv-migration): introducenode:crypto.createCipher & node:crypto.createDecipher
Member
|
@nodejs/crypto I'm not familiar with this part of node. could you check that the |
node:crypto.createCipher & node:crypto.createDeciphercrypto.createCipher & crypto.createDecipher
JakobJingleheimer
approved these changes
Jan 25, 2026
Member
JakobJingleheimer
left a comment
There was a problem hiding this comment.
Looks fine to me! I'd like someone from the crypto team to take a look at the before & after test fixtures though before landing this.
Co-Authored-By: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
avivkeller
approved these changes
Feb 2, 2026
tniessen
reviewed
Feb 4, 2026
| name: Apply AST Transformations | ||
| type: automatic | ||
| steps: | ||
| - name: Migrate `crypto.createCipher()`/`createDecipher()` to iv variants with secure key derivation. |
Member
There was a problem hiding this comment.
Suggested change
| - name: Migrate `crypto.createCipher()`/`createDecipher()` to iv variants with secure key derivation. | |
| - name: Migrate `crypto.createCipher()`/`createDecipher()` to IV variants with secure key derivation. |
|
|
||
| - The codemod cannot guarantee algorithm-specific key/IV sizes. Review the generated `scryptSync` length and IV length defaults and adjust as needed. | ||
| - Decryption snippets include placeholders (`Buffer.alloc(16)`) that must be replaced with the salt and IV stored during encryption. | ||
| - If your project already wraps key derivation logic, you may prefer to adapt the generated scaffolding to call existing helpers. |
Member
There was a problem hiding this comment.
Suggested change
| - If your project already wraps key derivation logic, you may prefer to adapt the generated scaffolding to call existing helpers. | |
| - If your project already wraps key derivation logic, you may prefer to adapt the generated scaffolding to call existing helpers. | |
| - The generated code is not backward-compatible and will be unable to decrypt data that was encrypted using `createCipher()`. | |
| - The use of scrypt is one possible choice for deriving a key from a password, but you may wish to use Argon2id or PBKDF2 instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
@nodejs/v20-to-v22Related issue
close #264