Skip to main content

What is the purpose of the crypto module in Node.js?

Mid NodeJS
Quick Answer The crypto module provides cryptographic functions รขโ‚ฌโ€ hashing (SHA-256, bcrypt via third-party), HMAC signatures, encryption/decryption (AES), generating random bytes, and creating digital signatures. Use it for password hashing, JWT signing verification, generating secure tokens, and encrypting sensitive data. Never roll your own crypto รขโ‚ฌโ€ use this.

Answer

The crypto module provides hashing, encryption, decryption, signing, and random data generation for secure operations.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice