DEV Community

Cover image for Encryption and Decryption in Node Js with Express and mongoose.
Saran Barua
Saran Barua

Posted on

Encryption and Decryption in Node Js with Express and mongoose.

Introduction
Learning NodeJS is a great opportunity for every web developer: Tons of jobs, easy to learn and, as Javascript is a MUST on web developing for the FrontEnd, you already know the language!

### Overview of Encryption and Decryption
Encryption is the process of translating plain text data (plaintext) into something that appears to be random and meaningless (ciphertext). Decryption is the process of converting ciphertext back to plaintext. To encrypt more than a small amount of data, symmetric encryption is used.

->
Install all package.Json file like this image

Image description

->
Create a app.js file...
ecncyption
Image description

decryption

Image description

**

-> Simple Schema/Model

**

const mongoose=require('mongoose');

const userSchema = new mongoose.Schema({
name: String
})

module.exports= mongoose.model("User", userSchema)

Now run the server and check in Postman.

Top comments (0)