Does Node.js supports cryptography?

Yes, Node.js Crypto module supports cryptography. It provides cryptographic functionality that includes a set of wrappers for open SSL’s hash HMAC, cipher, decipher, sign and verify functions. For example:

  1. const crypto = require(‘crypto’);    
  2. const secret = ‘abcdefg’;    
  3. const hash = crypto.createHmac(‘sha256’, secret)    
  4.                    .update(‘Welcome to JavaTpoint’)    
  5.                    .digest(‘hex’);    
  6. console.log(hash);