Help me please!

using System.Security.Cryptography.ECDiffieHellmanCng create a public key for a 128 bit private key. My code

 ECDiffieHellman m_ECDiffieHellman = new ECDiffieHellmanCng(128); List<byte> publicKey = m_ECDiffieHellman.PublicKey.ToByteArray().ToList(); 

Falls into the exception

Необработанное исключение типа "System.Windows.Markup.XamlParseException" в PresentationFramework.dll

I suspect that the designer does not accept the size of 128 bits, the question is how to be then?

Instructions for the device below enter image description here

  • 2
    You need to read the documentation for this constructor overload. The admissible key length is 256, 384 and 521 bits. - Alexis
  • Look for third-party implementation: Chilkat, BouncyCastle, etc. - Alexis

0