diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 94e7dcd15734b3..771bcef6a84891 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1254,7 +1254,11 @@ This property is deprecated. Please use `crypto.setFips()` and ### crypto.createCipher(algorithm, password[, options]) + +> Stability: 0 - Deprecated: Use [`crypto.createCipheriv()`][] instead. + - `algorithm` {string} - `password` {string | Buffer | TypedArray | DataView} - `options` {Object} [`stream.transform` options][] @@ -1334,7 +1338,11 @@ called. ### crypto.createDecipher(algorithm, password[, options]) + +> Stability: 0 - Deprecated: Use [`crypto.createDecipheriv()`][] instead. + - `algorithm` {string} - `password` {string | Buffer | TypedArray | DataView} - `options` {Object} [`stream.transform` options][] diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 7e520412c0db72..d8345c84b9ba4e 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -959,11 +959,25 @@ Type: Runtime [`decipher.final()`][]. In the future, this API will likely be removed, and it is recommended to use [`decipher.final()`][] instead. + +### DEP0106: crypto.createCipher and crypto.createDecipher + +Type: Documentation-only + +Using [`crypto.createCipher()`][] and [`crypto.createDecipher()`][] should be +avoided as they use a weak key derivation function (MD5 with no salt) and static +initialization vectors. It is recommended to derive a key using +[`crypto.pbkdf2()`][] and to use [`crypto.createCipheriv()`][] and +[`crypto.createDecipheriv()`][] to obtain the [`Cipher`][] and [`Decipher`][] +objects respectively. + [`--pending-deprecation`]: cli.html#cli_pending_deprecation [`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size [`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array [`Buffer.from(buffer)`]: buffer.html#buffer_class_method_buffer_from_buffer [`Buffer.isBuffer()`]: buffer.html#buffer_class_method_buffer_isbuffer_obj +[`Cipher`]: crypto.html#crypto_class_cipher +[`Decipher`]: crypto.html#crypto_class_decipher [`assert`]: assert.html [`clearInterval()`]: timers.html#timers_clearinterval_timeout [`clearTimeout()`]: timers.html#timers_cleartimeout_timeout @@ -976,7 +990,11 @@ is recommended to use [`decipher.final()`][] instead. [`child_process`]: child_process.html [`console.error()`]: console.html#console_console_error_data_args [`console.log()`]: console.html#console_console_log_data_args +[`crypto.createCipher()`]: crypto.html#crypto_crypto_createcipher_algorithm_password_options +[`crypto.createCipheriv()`]: crypto.html#crypto_crypto_createcipheriv_algorithm_key_iv_options [`crypto.createCredentials()`]: crypto.html#crypto_crypto_createcredentials_details +[`crypto.createDecipher()`]: crypto.html#crypto_crypto_createdecipher_algorithm_password_options +[`crypto.createDecipheriv()`]: crypto.html#crypto_crypto_createdecipheriv_algorithm_key_iv_options [`crypto.DEFAULT_ENCODING`]: crypto.html#crypto_crypto_default_encoding [`crypto.fips`]: crypto.html#crypto_crypto_fips [`crypto.pbkdf2()`]: crypto.html#crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback