Public and Private key cryptography using javascript crypto module

preview_player
Показать описание
Generated public key and private key using standard RSA algorithm with the length of 256 and used public key to encrypt data and decryption using private key.

This program uses sha256 hash function .

Follow along if you want to know how to use ES6 module system.

code :

import crypto from "crypto";

const data = " Hello world how are you"; //something to encrypt

modulusLength: 2048, //for secure hashing length of a hashfunction
})

// encryption function
//using sha256 but you can use any sha524 or others
key: publicKey,
oaepHash: "sha256"

// now lets decrypt

key: privateKey,
oaepHash: "sha256"
},encryptMe);

Рекомендации по теме
Комментарии
Автор

Thanks for the detailed explanation, curious to know how to implement the same logic inside Postman using pre-request script?

DhrumilSoni
Автор

Hi, thanks for making this video.
Just question, why it doesn't work when I am using : npm init -y ?

safaaal-harazin
Автор

Great video, bro! Thanks a lot!!

Just for curiosity, what VSCode theme are you using :v?

ndrewcoding