2
$\begingroup$

I recently got into learning Elliptical curve cryptography and are currently building a project in C#.

Everything is working well so far, I can encode and decode points, and thanks to this forum I can do point addition and doubling really fast. Now I want to take the next step and start using really big numbers, so far I've been working off different ECC samples and papers normally using really small primes and numbers for clarity. The end goal is to being able to encrypt and decrypt a text, this will later be used for digital signing of this text. So what I must figure out now is:

  1. What standard curves could I use? I know curves like p192 etc exists, am I allowed to use these?
  2. How can I find valid points to use for messages and generator on these huge curves? So far I've done it using brute force on smaller curves with a small prime. I can't find any using my previous brute force approach since the numbers are too large.
  3. Whats a good way for encoding/decoding text using ECC? Should I simply map each valid character to a point on the curve and perform encryption/decryption once for each character and translate between the character and point using a lookup table?

Thank you!

$\endgroup$
0

1 Answer 1

1
$\begingroup$
  1. What standard curves could I use? I know curves like p192 etc exists, am I allowed to use these?

Yes, of course you may use those, for more curves - including safer ones - check the safecurves website.

  1. How can I find valid points to use for messages and generator on these huge curves? So far I've done it using brute force on smaller curves with a small prime. I can't find any using my previous brute force approach since the numbers are too large.

This is part of key generation procedure. For Elliptic Curve the private key is a vector (usually of order N) and the public key is calculated for this particular vector. So this is basically asking how EC key generation takes place (for which there are tutorials available online, I won't completely explain it here).

  1. Whats a good way for encoding/decoding text using ECC? Should I simply map each valid character to a point on the curve and perform encryption/decryption once for each character and translate between the character and point using a lookup table?

No, you shouldn't directly encrypt anything with EC crypto, try and look up ECIES instead, it is basically ECDH key agreement coupled with symmetric cryptography on the derived key. Start with ECDH and then implement ECIES. Progress on with ECDSA if you want to have signatures.

EC is different than RSA in this regard, you cannot just alter the padding scheme (as there is no padding scheme).

$\endgroup$
7
  • $\begingroup$ Community wiki because of (2). Feel free to edit. $\endgroup$
    – Maarten Bodewes
    Nov 27, 2014 at 10:57
  • $\begingroup$ Regarding 2.) To generate keys I need to pick a generator point which must be a point on the curve. And for the message I also need a point on the curve. So for these reasons I need to find a method on how to find valid points on the curve right? $\endgroup$
    – Johan O
    Nov 27, 2014 at 12:53
  • $\begingroup$ Regarding 3.) The use case for ECC here is a bit different. I'm going to use it for generating serial keys for the software I write. So I basically only want a way to decrypt an encrypted hash using a public key, this is to prevent hackers from creating key generators for my applications. Is it ECDSA I want to use then? The thing is I want the encrypted hash to look like a serial key (for example all upper case letters etc) and have a reasonable length. $\endgroup$
    – Johan O
    Nov 27, 2014 at 12:56
  • $\begingroup$ Encrypting a hash sounds like ECDSA to me... $\endgroup$
    – Maarten Bodewes
    Nov 27, 2014 at 13:20
  • $\begingroup$ @JohanO To prevent key generators in a licensing scheme a signature is a better choice than encryption, provided you can live with a ~40 byte signature (longer once encoded as characters). $\endgroup$ Nov 27, 2014 at 14:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.