Node.js 22 removes crypto.createCipher, forcing Lambda developers to migrate
Node.js 22 has permanently removed the crypto.createCipher and crypto.createDecipher functions, breaking any AWS Lambda functions upgraded to the nodejs22.x runtime. The removed functions had been deprecated since Node.js v10 due to weak key derivation — using a single MD5 iteration with no salt — making them vulnerable to brute-force and dictionary attacks. Developers must now use crypto.createCipheriv, which requires an explicitly supplied key and initialization vector, encouraging proper key derivation practices. The migration involves generating a random salt per encryption, deriving a secure key using crypto.scryptSync, and storing the salt and IV alongside the ciphertext for later decryption. The change is particularly timely as teams are proactively upgrading from nodejs20.x, which faces a deprecation deadline with update restrictions arriving in early 2027.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in