From the course: Node.js: Security

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Encrypt user data and session management

Encrypt user data and session management

From the course: Node.js: Security

Start my 1-month free trial

Encrypt user data and session management

- [Instructor] Another strong recommendation for properly securing your Node.js application is to encrypt your user data across all communication channels. So when your server and client are exchanging data, use Node.js packages like Crypto. Crypto allows you to encrypt your sensitive data with several methods to create hash data with secret words and hash algorithms. By having the proper secret and algorithm on the application and the server, you can encrypt and decrypt sensitive data, so if anyone intercepts your data, you minimize the possibility they can decipher your data. So go to nodejs.org\api \crypto.html-crypto_crypto, and once you get to this page you'll see what kind of set up you need to actually use Crypto. So for example, you import Crypto here and then you set up your secret. So you'll create your hash word here by using Crypto with the algorithm, and then this is the word that you want, and then you digest it. And if you console log this hash, it will print something…

Contents