FourQ: A Story of Elliptic Curves Microsoft Research and Cloudflare

Building a Fast Future

Photo by Taneli Lahtinen on Unsplash

FourQ: A Story of Elliptic Curves, Microsoft Research and Cloudflare

Building a Fast Future

The core of the security you are using to access this page is probably provided with Elliptic Curve Cryptography (ECC), and where the session key is created through ECDH (Elliptic Curve Diffie Hellman). While there are a number of curves we can use, such as NIST P-256, Curve 25519 (as used in Tor) and Secp256k1 (as used with Bitcoin), there are some doubts about their security and their performance. And so Microsoft Research has produced the FourQ curve and which has 128-bit security. It is open source and runs efficiently on a number of platforms. If you are interested the prime number used is the Mersenne prime of 2¹²⁷-1 [here]:

In tests, the Microsoft team showed that FourQ was four or five times faster than the NIST P-256 curve, and two or three times faster than Curve 25519. As so we turn to the wonderful Cloudflare, and their Circl library. Within this, Cloudflare has implemented FourQ, and is here:

With this, Alice produces her private key (a), and Bob produces his private key (b). We select a point on the elliptic curve (G), and Alice passes aG to Bob, and Bob passes bG to Alice. The shared key is then abG. A sample run is:


== Fourq key sharing
Alice Secret: 4d4ae7584414589e7688507cbd0eb1f107352176eac219ec49d698e0868f83a6
Alice Public: 6e34b72d675cf331ed856393580e9f74fce2a9d2cce10f2e15d58070a70d2567
Bob Secret: 19b5c6a97dad74f0ffdaf9cb4bec561de3124b4c90f90f2f618db6cc0f5f9b8e
Bob Public: e2159ddc2efc501ccc01f1df78d5d14061edf3b284ae98095e747b7aeac63306
Bob Shared: 0112c5090679d20d4363a670ff61d554284519c6d371e61cc9526d65d5a763a0
Alice Shared: 0112c5090679d20d4363a670ff61d554284519c6d371e61cc9526d65d5a763a0

And, in the end, Bob and Alice have the same shared key, and which they could use for a tunnel.

Conclusions

ECC is such an interesting topic. Here is a demo:

.