Image for post
Image for post
Photo by Isaac Smith on Unsplash

What has a point x=9, and protects your security?

Well, that will be Curve 25519, and takes a base point at x=9, and then uses:

Image for post
Image for post

and where p = 2²⁵⁵-19. It is a curve that is used in lots of applications, including within the Tor network, and where each Tor node performs a Curve 25519 ECDH key exchange (known as X25519). Each of nodes then end up with their own derived symmetric key, and the encryption is performed with onion wrapping for the data.

So what’s the y co-ordinate at x=9? We need to find the value that will fit the equation about, given the value of x and p. For this, we need to find the modulo square of the equation given a value of x=9, and in the end we get:

If you want to prove this, here’s a simple Python proof:

Image for post
Image for post

Notice that y² (mod p) and x³+ax² +x (mod p) are the same. For the point addition, we can use the method defined in https://tools.ietf.org/html/rfc7748 to calculate 2P:

And so here is my code for Curve25519 and other popular curves:

And the code here:

Elliptic Curve Cryptography (ECC) is just beautiful in its formation, and Curve 25519 is especially special.

Written by

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. EU Citizen. Auld Reekie native. Old World Breaker. New World Creator.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store