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

Поділитися
Вставка
  • Опубліковано 19 лис 2024

КОМЕНТАРІ • 60

  • @SASA_maxillo
    @SASA_maxillo 5 місяців тому +1

    Bro i can't thank you enough, every video is useless except for yours, thank you.

  • @NhanNguyen-rh4lg
    @NhanNguyen-rh4lg 4 роки тому +3

    Perfect!!! You must be god and saving me Asymmetric, many thank!

    • @TechnoSaviour
      @TechnoSaviour  4 роки тому

      Thanks for your encouraging words 🙏

  • @MonicaloveNiallHoran
    @MonicaloveNiallHoran 2 роки тому

    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!

  • @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.

  • @penguasaphonty8749
    @penguasaphonty8749 3 роки тому +1

    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?

  • @arun0686
    @arun0686 2 роки тому +1

    Hi im getting error like RSA PADDING CHECK PKCS1 OAEP ,OAEP DECODING ERROR ..help me

  • @evendevilscry1431
    @evendevilscry1431 4 роки тому +1

    Nice video. Got so much to learn.. Thank you

  • @SwetavSavarn
    @SwetavSavarn 5 місяців тому

    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

  • @abhishekpatel7624
    @abhishekpatel7624 3 роки тому

    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?

  • @okzowarz2275
    @okzowarz2275 7 місяців тому

    how can
    i use with client side

  • @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?

  • @rosalyna_24
    @rosalyna_24 3 роки тому +1

    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

  • @alejandrobermudez8799
    @alejandrobermudez8799 2 роки тому

    Very very useful information. Thank you very much.

  • @snehasamuel7426
    @snehasamuel7426 Рік тому +1

    why cant i use the private key for encryption and public key for decryption

    • @SASA_maxillo
      @SASA_maxillo 5 місяців тому +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

  • @TrungNguyen-hx3ps
    @TrungNguyen-hx3ps 3 роки тому +1

    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?

  • @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?

  • @vipul8512
    @vipul8512 Рік тому

    Can we use this in angular 12?

  • @david-tracy
    @david-tracy 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: ua-cam.com/video/AQDCe585Lnc/v-deo.html&ab_channel=SimplyExplained

    • @saditya
      @saditya 2 роки тому

      depends who is sending the data to whom

  • @gsiva3577
    @gsiva3577 2 місяці тому

    Super

  • @mohamedzemzemi1257
    @mohamedzemzemi1257 4 роки тому +2

    GG mate, thanks

  • @adaadutv9426
    @adaadutv9426 4 роки тому +1

    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

  • @naumanshigri
    @naumanshigri 3 роки тому +1

    aju xheringmo.. very helpful

  • @anejatu1312
    @anejatu1312 3 роки тому

    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.

  • @Unstoppable.Sakshi
    @Unstoppable.Sakshi 2 роки тому +1

    Thank you for help .. But How I can apply this on my message in my project

  • @00WhiteDragon
    @00WhiteDragon 4 роки тому +1

    Nice vid.

  • @MrRiseful
    @MrRiseful 4 роки тому

    Like it!

  • @matinzd
    @matinzd 2 роки тому +1

    You could just use built in crypto lib.

  • @t-pk
    @t-pk 4 роки тому +1

    thanks

  • @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

  • @liveabhishekshukla
    @liveabhishekshukla 4 роки тому +1

    Please type fast.. video length will be small..

  • @gguitarp1
    @gguitarp1 4 роки тому

    Why not just use nodejs’s native crypto module?

    • @TechnoSaviour
      @TechnoSaviour  4 роки тому +1

      You can use, I was focused on showing how it works

  • @ІлляБезуглий-т2з
    @ІлляБезуглий-т2з 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 роки тому +1

      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(......

  • @dennisgonzales9521
    @dennisgonzales9521 3 роки тому

    Thanks