I'm using ECDH for generating shared key for STM32 MCU. Which encryption/decryption algorithm should I use? I looked at RSA and AES project samples provided by STM32 but where do I provide shared key with message to encrypt?

With the current implementation shared key size is 64 bits.

  • 4
    $\begingroup$ Do not use as reference any code that has a 64-bit shared key. That's very insecure by modern standards. Do not roll your own protocol (or use the protocol in a random piece of code), there are many things to miss. $\endgroup$
    – fgrieu
    Commented Jul 7, 2023 at 5:58
  • $\begingroup$ If you're getting 64 bit shared secret, does that mean you also use 64 bit ECDH? $\endgroup$
    – Maarten Bodewes
    Commented Jul 8, 2023 at 0:38
  • $\begingroup$ i changed my implementation to get 128 bits shared key $\endgroup$
    – minion
    Commented Jul 8, 2023 at 3:34
  • $\begingroup$ @minion: I trust you are using a larger (e.g. 256 bit) elliptic curve when doing the ECDH $\endgroup$
    – poncho
    Commented Jul 8, 2023 at 19:00
  • $\begingroup$ @poncho - im using 512 bit elliptic curve $\endgroup$
    – minion
    Commented Jul 12, 2023 at 1:25


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.