Core ModulesLesson 30Free preview
Crypto Module
This lesson is part of Node.js · All levels
Summary
Crypto modules provide inborn cryptographic capabilities such as hashing, encryption, decryption, and random value creation. You can create a SHA-256 hash to verify integrity or generate a secure random token. This module is particularly relevant for application authentication and security.
Key points
- CreateHash produces a fixed hash like sha256 from a data
- CreateCipheriv/createDecipheriv for symmetric encryption (e.g. aes-256-cbc)
- RandomBytes generate a cryptographically secure token or IV
- Hash is one-way and cannot be reversed to the original text
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.