No video

Asymmetric Encryption and Decryption in Node.js using RSA Public/Private Key Pairs

  Рет қаралды 26,119

Techno Saviour

Techno Saviour

Күн бұрын

#node-rsa #rsa #asymmetricencryption #piblicprivatekey
Learn how to do encryption using public key and decryption using the private key in Nodejs
This is a code walkthrough. to understand why and when to use RSA please watch the previous video in the playlist.
Amazon Link: amzn.to/36pZN09
Nodejs: nodejs.org/en/...
npm package: www.npmjs.com/...
Visual studio code: code.visualstu...
Check out the playlist about RSA
• RSA

Пікірлер: 59
@SASA_maxillo
@SASA_maxillo 2 ай бұрын
Bro i can't thank you enough, every video is useless except for yours, thank you.
@MonicaloveNiallHoran
@MonicaloveNiallHoran Жыл бұрын
Thank you! your video helped me to implement a pair of RSA keys encrypting-decrypting function in my code for my exam project, very useful and well-explained!
@NhanNguyen-rh4lg
@NhanNguyen-rh4lg 4 жыл бұрын
Perfect!!! You must be god and saving me Asymmetric, many thank!
@TechnoSaviour
@TechnoSaviour 4 жыл бұрын
Thanks for your encouraging words 🙏
@12XFactor
@12XFactor 3 жыл бұрын
That's good for the basics. To people who think about using exactly that solution, I would recommend not generate the keys one time and use them forever. Generate new keys for every package you want to send. The first information exchange will be the public keys of client and server and the second exchange round is transmitting the encrypted package. To make sure the package is not manipulated, extend the encryption with a signature.
@TechnoSaviour
@TechnoSaviour 3 жыл бұрын
Rightly pointed
@evendevilscry1431
@evendevilscry1431 3 жыл бұрын
Nice video. Got so much to learn.. Thank you
@alejandrobermudez8799
@alejandrobermudez8799 2 жыл бұрын
Very very useful information. Thank you very much.
@SwetavSavarn
@SwetavSavarn 2 ай бұрын
I am quite confused in one thing . We are creating public and private key. And encrypting our string with that public key So if we are decrypting with private key how node-rsa specifiy that this private key is only used to decrypt the data not any other , as both public and private keys are independent not dependent to each other
@penguasaphonty8749
@penguasaphonty8749 3 жыл бұрын
I can't run this in node js 8 version. Can you tell me how can I do the same thing in node js 8 version using crypto?
@mohamedzemzemi1257
@mohamedzemzemi1257 3 жыл бұрын
GG mate, thanks
@TechnoSaviour
@TechnoSaviour 3 жыл бұрын
Thank you too!
@naumanshigri
@naumanshigri 2 жыл бұрын
aju xheringmo.. very helpful
@okzowarz2275
@okzowarz2275 4 ай бұрын
how can i use with client side
@arun0686
@arun0686 Жыл бұрын
Hi im getting error like RSA PADDING CHECK PKCS1 OAEP ,OAEP DECODING ERROR ..help me
@Cdswjp
@Cdswjp 2 жыл бұрын
I find it interesting that u use the public key for encryption & the private key for decryption. I usually read about it being the other way around. What is the reasoning behind doing this in your opinion?
@alejandrobermudez8799
@alejandrobermudez8799 2 жыл бұрын
Encrypt with public key an decrypt with private key is the way. Please watch the following video: kzfaq.info/get/bejne/d7d0dshmnZuwnpc.html&ab_channel=SimplyExplained
@saditya
@saditya 2 жыл бұрын
depends who is sending the data to whom
@snehasamuel7426
@snehasamuel7426 10 ай бұрын
why cant i use the private key for encryption and public key for decryption
@SASA_maxillo
@SASA_maxillo 2 ай бұрын
because the public key will travel through the internet but the private key can't, and a hacker can get the public key (because it is traveling though the internet) so when a hackers gets it, it's point less, because a public key can only encrypt and can't decrypt, so this is why RSA is a very safe way of transferring data
@abhishekpatel7624
@abhishekpatel7624 2 жыл бұрын
How the sign and verify works in node-rsa? I implement at my local but all time give me false verify all tho plain text, and keys are everything correct but not sure what happened? Can you please explain?
@SSinghalS
@SSinghalS 2 жыл бұрын
I am new to this, I have everything the same, but when I try to run it, the output is not displayed, could you tell me the reason?
@TrungNguyen-hx3ps
@TrungNguyen-hx3ps 3 жыл бұрын
Hello, I need to convert a NodeJS function (using the crypto-js library) to PHP. I can pay for it. Can you do that?
@labiV1
@labiV1 3 жыл бұрын
Yes I can do that. Is this job still available?
@rosalyna_24
@rosalyna_24 3 жыл бұрын
hiii nice video but how can i use this module to encrypt a file that i'm going to send
@TechnoSaviour
@TechnoSaviour 3 жыл бұрын
You can try converting the file to base64 string then encrypt it
@Unstoppable.Sakshi
@Unstoppable.Sakshi Жыл бұрын
Thank you for help .. But How I can apply this on my message in my project
@Unstoppable.Sakshi
@Unstoppable.Sakshi Жыл бұрын
Please reply
@00WhiteDragon
@00WhiteDragon 4 жыл бұрын
Nice vid.
@TechnoSaviour
@TechnoSaviour 4 жыл бұрын
Thanks
@vipul8512
@vipul8512 Жыл бұрын
Can we use this in angular 12?
@paymentpablo
@paymentpablo Жыл бұрын
Any tips for reading an encrypted message that is encrypted elsewhere? I have the private key and I tried importing the private key but it keeps giving me an error saying the private key is wrong?
@vanigarlapati7083
@vanigarlapati7083 Жыл бұрын
any luck? I am also working on the same requirement.
@t-pk
@t-pk 4 жыл бұрын
thanks
@TechnoSaviour
@TechnoSaviour 3 жыл бұрын
You're welcome!
@dennisgonzales9521
@dennisgonzales9521 3 жыл бұрын
Thanks
@adaadutv9426
@adaadutv9426 4 жыл бұрын
Do you have example using asp.net core c#
@TechnoSaviour
@TechnoSaviour 4 жыл бұрын
I'm planning to make one with a combination of Angular and .net core
@MrRiseful
@MrRiseful 4 жыл бұрын
Like it!
@TechnoSaviour
@TechnoSaviour 3 жыл бұрын
Thank you! Cheers!
@anejatu1312
@anejatu1312 2 жыл бұрын
can we use custom private key for decryption, how can i achieve it
@alejandrobermudez8799
@alejandrobermudez8799 2 жыл бұрын
I try using a pair of keys (public an private) generated by the command "ssh-keygen -t rsa -b 4096 -a 100 -f mykey" and work very well. I hope it can be useful.
@matinzd
@matinzd 2 жыл бұрын
You could just use built in crypto lib.
@anisulashik8836
@anisulashik8836 2 жыл бұрын
can i use it in react js ??
@TechnoSaviour
@TechnoSaviour 2 жыл бұрын
Yes, it’s a browser feature can be implemented in any language
@andrewgad6746
@andrewgad6746 4 жыл бұрын
Nice vid, you could have used a string literal 8:10
@TechnoSaviour
@TechnoSaviour 4 жыл бұрын
Thanks, will use it for other videos
@liveabhishekshukla
@liveabhishekshukla 4 жыл бұрын
Please type fast.. video length will be small..
@TechnoSaviour
@TechnoSaviour 4 жыл бұрын
🤣 yeah ... Will work on it asap
@gguitarp1
@gguitarp1 4 жыл бұрын
Why not just use nodejs’s native crypto module?
@TechnoSaviour
@TechnoSaviour 4 жыл бұрын
You can use, I was focused on showing how it works
@user-qu8xu2gb4z
@user-qu8xu2gb4z 4 жыл бұрын
Thanks for the video, you give a good example, but you are talking way too slow
@TechnoSaviour
@TechnoSaviour 4 жыл бұрын
Thanks for your suggestion, I'm working on it
@kofestar
@kofestar 4 жыл бұрын
You can easily set the video speed
@adityasahoo7839
@adityasahoo7839 3 жыл бұрын
Facing some problem while encrypting with private key and decrypting with public key. Here is my code sample const nodeRsa = require('node-rsa'); const key = new nodeRsa({ b: 1024 }),//public and private keys publicKey = key.exportKey('public'); privateKey = key.exportKey('private'); let encryptedString = keyPrivate.encrypt("Secret", 'base64'); let decryptedStrig= keyPublic.decrypt(encryptedString, 'utf8'); Am getting the error message as Error during decryption (probably incorrect key). Original error: Error: This is not private key This message during decrypt. Please help. Thanks for this lovely video though.
@TechnoSaviour
@TechnoSaviour 3 жыл бұрын
You are using private key for encryption and public key for decryption. It should be other way round
@TechnoSaviour
@TechnoSaviour 3 жыл бұрын
Let encryptedstring = keyPublic.encrypt(......
طردت النملة من المنزل😡 ماذا فعل؟🥲
00:25
Cool Tool SHORTS Arabic
Рет қаралды 22 МЛН
Bony Just Wants To Take A Shower #animation
00:10
GREEN MAX
Рет қаралды 7 МЛН
Zombie Boy Saved My Life 💚
00:29
Alan Chikin Chow
Рет қаралды 27 МЛН
How I Did The SELF BENDING Spoon 😱🥄 #shorts
00:19
Wian
Рет қаралды 37 МЛН
Asymmetric Encryption - Simply explained
4:40
Simply Explained
Рет қаралды 1,3 МЛН
Why High Performers Might Be Hurting Your Team
6:42
Simon Sinek
Рет қаралды 2,8 М.
JWT using RSA Public/Private Key Pairs
8:15
Stuart Williams
Рет қаралды 51 М.
How To Manage User Roles In Node.js
22:45
Web Dev Simplified
Рет қаралды 307 М.
Diffie Hellman | NodeJS | End-to-end Encryption
7:18
Mafia Codes
Рет қаралды 22 М.
طردت النملة من المنزل😡 ماذا فعل؟🥲
00:25
Cool Tool SHORTS Arabic
Рет қаралды 22 МЛН