# Elliptic curve cryptography in Mathematica

I can find no resources for doing elliptic curve cryptography. I have used the finite field package, but I find it cumbersome and it does not seem to have any builtin methods for ECC. How can I get started doing ECC in Mathematica?

• Might take a look at library.wolfram.com/infocenter/Conferences/6911
– ciao
Commented Mar 11, 2014 at 3:59
• I saw that, but it did not seem very practical. It's not really algorithms in Mathematica, its just a lecture on ECC written using Mathematica as a typesetter. Commented Mar 11, 2014 at 4:17
• As you want something practical, consider not writing it yourself, and instead using JLink to use EC algorithms from Java 7's JCA/JCE API: docs.oracle.com/javase/7/docs/technotes/guides/security/… Commented Mar 11, 2014 at 5:46
• @AndreasLauschke Yes, using a regular programming language, especially Python, is possible. Python has comprehensive crypto, plus there is a computational math system in Python called Sage that fully supports finite fields. I was just hoping that it would be already in Mathematica somehow. Of course, I could write all the modular arithematic needed from scratch, too, I suppose. Commented Mar 11, 2014 at 12:36
• @Tyler: yes, I know Python is popular for crypto work. But you can't easily integrate it with M (at least to my knowledge), whereas with JLink it's right at your fingertips to leverage over from M to the JVM, and you mentioned "practical" in a comment. Commented Mar 11, 2014 at 17:21

Here is a link to the guide page for Cryptography functions in the Wolfram Language:

https://reference.wolfram.com/language/guide/Cryptography.html

Here is a link to the lower level number theory functions related to cryptography:

https://reference.wolfram.com/language/guide/CryptographicNumberTheory.html

In response to the comment regarding Python, here is a new guide page related to calling Python (and other languages) directly from the Wolfram Language:

https://reference.wolfram.com/language/guide/ExternalLanguageInterfaces.html

• Shows how Mathematica has evolved... Commented Sep 1, 2020 at 7:22

I have a notebook available from my homepage, where I did some cryptography with Mathematica:

https://www.mat.univie.ac.at/~gerald/ftp/notebooks/

It is just intended for teaching and right now it only supports EC operations over $$\mathbb{Z}_p$$.

Update: I have packed the EC operations into a package (also available via the link above). It supports some (moderately) advanced stuff like computing the group order via Schoof's algorithm and solving discrete log problems (Pohlig-Hellman reduction + Shank's baby-step/giant-step). Up to around 10 decimal digits should work. Basic operations are fast on real curves like the one used for bitcoin. It is not well-tested and not everything is documented (use the force, read the source;-)