AES 256 GCM and ECDH | Authenticated Encryption and Decryption | End-to-end Encryption

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024
  • In this video you will learn how to use the shared key generated using #ECDH to encrypt and decrypt messages using the symmetric key #AES256 algorithm with authenticated encryption method i.e. #GCM (Galois/Counter Mode).
    ⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I've been using Kite for 6 months and I love it! www.kite.com/g...
    Github(ECDH tutorial): github.com/tru...
    ---------------
    Other useful Videos
    ---------------
    Diffie Hellman analogy: • End-to-end Encryption ...
    Diffie Hellman Mathematics: • Diffie Hellman Mathema...
    Diffie Hellman Nodejs: • Diffie Hellman | NodeJ...
    Elliptic-Curve Diffie-Hellman (ECDH): • Elliptic-Curve Diffie-...
    AES (Advanced Encryption Standard): • AES - Advanced Encrypt...
    ECDH + AES 256 (CBC): • ECDH and AES 256 | Enc...
    ECDH + AES 256 GCM (Authenticated Encryption): • AES 256 GCM and ECDH |...
    ---------------
    Other useful Playlists
    ---------------
    Docker: • Docker
    MongoDB: • Learn MongoDB in 50 mi...
    Html/Css/Js: • HTML / CSS / JS
    Android: • Android
    Firebase: • Firebase | Build a Not...
    Challenges: • Challenges
    ---------------
    What I use
    ---------------
    Mouse: amzn.to/2O9RJtu
    Keyboard: amzn.to/2qxajCU
    Keyboard 2: amzn.to/2XDWH4X
    Monitor: amzn.to/2pDg7dH
    Processor: amzn.to/347WWIb
    RAM: amzn.to/2QEkUqw
    Graphics: amzn.to/33aBrF4
    Microphone: amzn.to/2DabdI9
    #yoursTruly #tutorial #how-to
    #Elliptic-curve-diffie-hellman #advanced-encryption-standard

ความคิดเห็น • 38

  • @rohanranamagar1502
    @rohanranamagar1502 11 หลายเดือนก่อน +2

    If bob and alice are different machine how can you access bobSharedKey ?
    Here you are using both in one file?

  • @mukeshbagaria4089
    @mukeshbagaria4089 ปีที่แล้ว +1

    can you help me that which library can be used in flutter to implement ?

    • @mafiacodes
      @mafiacodes  ปีที่แล้ว

      This should be build inside flutter itself, I am not sure

  • @blaze738
    @blaze738 4 ปีที่แล้ว +5

    thank you for such a great playlist on end to end encryption!
    i was wondering what could be the best approach for encrypting a group chat as there will be a lot of users

    • @mafiacodes
      @mafiacodes  4 ปีที่แล้ว +1

      Well again use diffie Hellman

    • @pratikgohil7821
      @pratikgohil7821 ปีที่แล้ว

      consider group as a user, and sender are other user

  • @vaishnavithaware1293
    @vaishnavithaware1293 2 ปีที่แล้ว

    Thnk you so much for this video.. its really helpful.😍 Plz make video on AES_256_ECB encryption

  • @NikhilSharma-qk8sr
    @NikhilSharma-qk8sr 4 ปีที่แล้ว +3

    How would you go about storing the messages in the database? if it is end to end encrypted the shared keys will change and you wont be able to view the past messages that are stored in the database (i.e. if you store the cipher text as is in the database). what would you suggest for saving messages in database? is it possible to store the messages in such a way that only the two parties like alice and bob can decipher the messages in database.

    • @mafiacodes
      @mafiacodes  4 ปีที่แล้ว +1

      Well u can store the cipher in db, since Bob Alice generated on a common shared key which they can use to decipher.

    • @NikhilSharma-qk8sr
      @NikhilSharma-qk8sr 4 ปีที่แล้ว

      @@mafiacodes but wont the shared key change over time? all the control over the key generation is with client. the server cannot know. so when the app gets uninstalled and then installed again or something like that. wont the key change? how do you make the private keys persistent if the keys can only be generated in client and server cant know about it?

    • @mafiacodes
      @mafiacodes  4 ปีที่แล้ว +3

      See if server knows about the keys or u store them somewhere in outside the client then the whole purpose of end to end is deceived. For example whatsapp, fb messenger they use signal protocol where for every message they use 3 diffi Hellman - 3 key exchanges for a single message. If your interested read more about the signal protocol because that is what eventually you should use when makin a million dollar 💵 app. It’s open source by open whisper systems.
      As far as this goes you can use it for a simple project and the message will be e2e encrypted.

  • @syedwaseemahmed1749
    @syedwaseemahmed1749 3 หลายเดือนก่อน

    In javascript how to do??

  • @LucasLopes-hd1ms
    @LucasLopes-hd1ms 3 ปีที่แล้ว +1

    Great video.

  • @huyifan83
    @huyifan83 3 ปีที่แล้ว

    I have a question. What's the recommended way to generate IV? I heard that using a 12 byte random string is not safe enough. Is there any other ways?

  • @IntactAbode
    @IntactAbode 4 ปีที่แล้ว

    The shared key you are using in this tutorial is 512 bit encrypted key right?

  • @kubak3381
    @kubak3381 3 ปีที่แล้ว +1

    Great, how do I do it in browser AND how to make it handle a ReadableStream?

    • @mafiacodes
      @mafiacodes  3 ปีที่แล้ว

      use elliptic curve library

  • @PlusFlo
    @PlusFlo 3 ปีที่แล้ว

    Great video! Thx! Would you make a video that demonstrates the said Signal-E2EE?

  • @bilalo3interfaces460
    @bilalo3interfaces460 2 ปีที่แล้ว

    How can I convert the same code in to Kotlin?

  • @techworld7515
    @techworld7515 4 ปีที่แล้ว +1

    I want to use 12 byte IV is it possible to do so?

  • @Anto-mi5pn
    @Anto-mi5pn 3 ปีที่แล้ว

    How do you do this on the front end? One of the key points of E2EE is not to let your server know about the messages. So this has to happen completely on the client side, right?

    • @Cris-lg5iz
      @Cris-lg5iz 3 ปีที่แล้ว

      This is my concern too...

  • @Aki2024.
    @Aki2024. 2 ปีที่แล้ว

    Is wolfssl more secure than aes 256 gcm?

  • @rosalyna_24
    @rosalyna_24 3 ปีที่แล้ว

    hey this is usch a great video i'm wondering if u can do a video about encryting and decryting a file using RSA algorithm

  • @melquisedechernandezdoming2351
    @melquisedechernandezdoming2351 3 ปีที่แล้ว +2

    You're a god. :3

    • @mafiacodes
      @mafiacodes  3 ปีที่แล้ว +2

      God is one and only one - I am a simple human being 😊

  • @INFAmadeOFF
    @INFAmadeOFF 4 ปีที่แล้ว

    how do you run this now? need a video of you using this

    • @mafiacodes
      @mafiacodes  4 ปีที่แล้ว

      That’s what was explained here, just use ur server to exchange the public keys 🔑 and then u can use them to generate a shared secret.
      Subscribe like share

  • @bilalo3interfaces460
    @bilalo3interfaces460 2 ปีที่แล้ว

    I need this same algo in android . Can you help me in that. would be appreciated.

    • @mafiacodes
      @mafiacodes  2 ปีที่แล้ว

      yes I have that for android, but not planning to sell it 😃

    • @afnanhaider512haider7
      @afnanhaider512haider7 2 ปีที่แล้ว

      @@mafiacodes No worries. I did it myself. :D

    • @mukeshbagaria4089
      @mukeshbagaria4089 ปีที่แล้ว

      @@afnanhaider512haider7 can you let me know what you used for it?

  • @suhin8675
    @suhin8675 4 ปีที่แล้ว

    In line 56 how the bobshared key is sent to an server

    • @mafiacodes
      @mafiacodes  4 ปีที่แล้ว +1

      By any mechanism you like, typically in request body. But only you need to share the bobs public key and not the shared key.

    • @suhin8675
      @suhin8675 4 ปีที่แล้ว

      @@mafiacodes so the bob_payload has the key??

    • @mafiacodes
      @mafiacodes  4 ปีที่แล้ว

      The payload which Bob recieved has three things namely the iv, encrypted msg and auth tag. So he used his decipher to get back the msg.