For school (high school) I am writing an essay on elliptic curve cryptography. The assignment needs to include a practical part, so I decided to write a Python class for elliptic curves. This class is capable of performing elliptic curve arithmetic and can encrypt files using MV-ElGamal (although it is horribly slow).

The problem is that I need to present my research, including the practical part, to fellow high school students. I considered writing a chat app or something similar, with a connection secured by elliptic curve diffie-hellmann+AES256 and elliptic curve digital signatures, however, I'm not sure how easy that is. What would you suggest? I am looking for something simple, with the focus on the cryptography as much as possible, since that is what my essay is about. I also don't want something too ambitious since I am still only a beginner when it comes to programming (I am more into the math side). Keep in mind that my audience is not particularly interested in mathematics nor programming though.

  • $\begingroup$ Diffie-Hellmann in high school... man, I went to a pretty tough high school back in the '60s/'70s, but the hardest things we had to do were on-the-fly translation of Latin passages from Virgil and Ovid into Anacreontic meter in French, or the like... nothing, ever as hard as this! I stand in awe and upvote this Q for sheer ambition, even though I wouldn't know how to start presenting Diffie-Hellmann even to senior programmers like me (which I guess tells you I don't understand it anywhere like deeply enough!-). $\endgroup$ – Alex Martelli Jan 4 '15 at 0:44
  • $\begingroup$ DH sounded quite straightforward to me... I am starting to doubt my own understanding now though. $\endgroup$ – Dasherman Jan 4 '15 at 0:45
  • $\begingroup$ Watch <a href="youtube.com/watch?v=l6jTFxQaUJA">this video</a>, by two of the experts in the field, who provide a gentle introduction to the topic of elliptic curve cryptography. Maybe you could build a clock-cryptography app and then point out that only the addition law changes when moving to elliptic curve cryptography. $\endgroup$ – user448810 Jan 4 '15 at 0:53
  • $\begingroup$ Elliptic-curve crypto still doesn't sound or feel anywhere like "straightforward" to me even though I may use it daily, but, don't let that hold you back -- I'm sure some common ancestor of ours, a great hunter a few myriad years ago, felt the same about these new-fangled polished rather than chipped stone adzes! New generations should pole-vault clean over the shoulders of us ancient "giants", not lazily stand on them as Newton posited... it's the only way to get as much progress over the next 3-4 centuries as we did over the last 3-4 ones, and man, do we need it!!! $\endgroup$ – Alex Martelli Jan 4 '15 at 1:01
  • $\begingroup$ That was a very nice presentation indeed. Thank you for sharing! $\endgroup$ – Dasherman Jan 4 '15 at 13:53

An encrypted chat application by itself will not really demonstrate anything, since from the users' point of view it will not (if done properly) be any different from an unencrypted one. To demonstrate the encryption, you would need to also use Wireshark or something similar to sniff packets on the network and see that they are encrypted. But if simply showing a ciphertext and saying "this is encrypted" is enough, you can just encrypt a file, which apparently you can already do.

| improve this answer | |
  • $\begingroup$ My encryption algorithm based on elliptic curves (MV-ElGamal) is quite slow though, which is why I'd rather use a ECDH key exchange followed by AES encryption, but how can I demonstrate this best? I'd like to keep things simple as possible. $\endgroup$ – Dasherman Jan 5 '15 at 10:27
  • $\begingroup$ If your program is really that slow, you probably need to work on it to make it faster. For example, are you using a naive exponentiation algorithm instead of square-and-multiply? $\endgroup$ – fkraiem Jan 5 '15 at 11:10
  • $\begingroup$ If you are referring to point exponentiation: yes I am using square and multiply (since that is what the security of elliptic curves relies on), however for modular squaring and cubing, I am simply using "$(x**2)%p$" or "$(x**3)%p$" $\endgroup$ – Dasherman Jan 5 '15 at 11:25
  • $\begingroup$ Then I'm not sure what the problem is on your implementation, but if it's unacceptably slow to encrypt a single message, there's surely one. I'd recommend fixing it over using AES, mostly for simplicity. $\endgroup$ – fkraiem Jan 5 '15 at 12:11
  • $\begingroup$ It takes about a second per kilobyte, so there's lots of room for improvement. I'm considering rewriting the function for reduction modulo $p$, although I'm not sure how much of a speed up that would be. The $p$ I'm planning on using comes from a NIST-curve (P-256) and they have an algorithm for reduction. $\endgroup$ – Dasherman Jan 5 '15 at 12:16

If you want to demonstrate ECC in a fairly transparent way, you can use my software "Academic Signature". You can easily find it: e.g. google "open source elliptic curve cryptography".

You can easily demonstrate key creation, en-/decryption and signatures and verification of signatures.

It is really not just a demo-program and uses elliptic curves up to 1024 bit group order. Standard sources, approved by the "agencies", will let you have 521 at most.

| improve this answer | |
  • 2
    $\begingroup$ Don't you think a 521-bit curve gives enough security? $\endgroup$ – CurveEnthusiast Jan 20 '17 at 14:05
  • 1
    $\begingroup$ One might even argue that 384-bit or smaller order is enough (depending on how much you fear multi-target attacks), after all we're not gonna get to be able to carry out the required $>2^{128}$ for this purpose anyways before quantum computers completely smack ECC security. cc @CurveEnthusiast $\endgroup$ – SEJPM Jan 20 '17 at 16:43
  • $\begingroup$ @SEJPM Completely agree! $\endgroup$ – CurveEnthusiast Jan 20 '17 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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