Tech
"TypeError: crypto.createCipher is not a function — migrating to createCipheriv on Node.js 22 Lambda"
If you bumped a Lambda function to nodejs22.x and your handler now dies on the first crypto call, this is the wall:
TypeError: crypto.createCipher is not a function
The function is simply gone from the crypto object in Node.js 22. Here is the full story and the migration path.
Why it was removed
crypto.createCipher(algorithm, password) derived the encryption key internally using OpenSSL's EVP_BytesToKey : MD5 digest, one iteration, no salt. That's broken ...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to