DEP0106: crypto.createCipher 和 crypto.createDecipher
类型: 运行时
应避免使用 crypto.createCipher()
和 crypto.createDecipher()
,因为它们使用弱密钥派生函数(不含盐的 MD5)和静态初始化向量。
推荐使用 crypto.pbkdf2()
或 crypto.scrypt()
导出密钥,使用 crypto.createCipheriv()
和 crypto.createDecipheriv()
分别获取 Cipher
和 Decipher
对象。
Type: Runtime
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()
or crypto.scrypt()
and to use
crypto.createCipheriv()
and crypto.createDecipheriv()
to obtain the
Cipher
and Decipher
objects respectively.