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?

  • $\begingroup$ Might take a look at library.wolfram.com/infocenter/Conferences/6911 $\endgroup$
    – ciao
    Commented Mar 11, 2014 at 3:59
  • $\begingroup$ 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. $\endgroup$ Commented Mar 11, 2014 at 4:17
  • $\begingroup$ 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/… $\endgroup$ Commented Mar 11, 2014 at 5:46
  • $\begingroup$ @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. $\endgroup$ Commented Mar 11, 2014 at 12:36
  • $\begingroup$ @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. $\endgroup$ Commented Mar 11, 2014 at 17:21

2 Answers 2


A few updates, since Wolfram has added a lot of cryptography functionality in recent versions.

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


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


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:


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

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


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;-)


Your Answer

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

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