阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js crypto.createDecipher

      Node.js crypto.createDecipher(algorithm, password[, options])版本历史

      版本变更
      v10.10.0Ciphers in OCB mode are now supported.
      v10.0.0废弃于: v10.0.0
      v0.1.94新增于: v0.1.94

      废弃: 改为使用 crypto.createDecipheriv() 。

      • algorithm < string>
      • password < string> | < Buffer> ||
      • options < Object> stream.transform options
      • Returns:

      Creates and returns a Decipher object that uses the given algorithm and password (key).

      The options argument controls stream behavior and is optional except when a cipher in CCM or OCB mode is used (e.g. ‘aes-128-ccm’). In that case, the authTagLength option is required and specifies the length of the authentication tag in bytes, see CCM mode.

      The implementation of crypto.createDecipher() derives keys using the OpenSSL function EVP_BytesToKey with the digest algorithm set to MD5, one iteration, and no salt. The lack of salt allows dictionary attacks as the same password always creates the same key. The low iteration count and non-cryptographically secure hash algorithm allow passwords to be tested very rapidly.

      In line with OpenSSL’s recommendation to use a more modern algorithm instead of EVP_BytesToKey it is recommended that developers derive a key and IV on their own using crypto.scrypt() and to use crypto.createDecipheriv() to create the Decipher object.


      更多内容请参考:Node.js crypto 加密,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录