views:

957

answers:

4

Please can you suggest any implementation of elliptical curve cryptography to be used on .NET platform?

Also if you have used them, can you tell me the recommended curves that should be used?

[EDIT]

As @FatCat mentioned, its implementation is available in .NET framework 3.5 but that is only available on windows vista. Can you please suggest another way/library to use it?

+4  A: 

The .NET Framework already includes Diffie-Hellman, which is an elliptic curve crypto algorithm. Look under System.Security.Cryptography.ECDiffieHellmanCng.

fatcat1111
Great!I tried it but cant find how to use it to encrypt a message. Doesn't seem to have any "Encrypt" function...Documentation of new classes in framework 3.5 sucks.
Hemant
Oh and now i realise that this will work only on Windows Vista.
Hemant
the *Cng suffix means the crypto work is offloaded to Windows CNG (Crypto Next Gen) which is avail in Windows Vista and later.
Michael Howard-MSFT
Hemant: the documentation of framework 3.5 is not so bad; do you understand what Diffie-Hellman is? It is not used by itself for encryption, it is used to derive a secret, shared key to be used with a symmetric cipher from two parties using public key cryptography (including RSA or EC).
bowenl2
+1  A: 

The way you usually use ECC for encryption is by using "Ephemeral-Static Diffie-Hellman".

It works this way:

  • Take the intended receivers public key (perhaps from a certificate). This is the static key.
  • Generate a temporary ECDH keypair. This is the ephemeral keypair.
  • Use the keys to generate a shared symmetric key.
  • Encrypt the data with the symmetric key.
  • Transmit the encrypted data together with the public key from the ephemeral keypair.

The receiver can now use the ephemeral public key and his own static private key to recreate the symmetric key and decrypt the data.

You can read more in Standards for Efficient Cryptography: SEC 1: Elliptic Curve Cryptography section 5.1.3.

Rasmus Faber
+5  A: 

Check out the Bouncy Castle library for C#, it has ECDH and ECDSA.

Chochos
Thanks Chochos. I have successfully used Bouncy Castle library. It was little difficult to find the documentation though! :)
Hemant
+1  A: 

Have a look at SecureBlackBox components

Conrad