[Back] Curve 25519 is one of the most widely used ECC methods. It uses a curve of \(y^2 = x^3 + 486662 x^2 + x\), and which is a Montgomery curve, over the prime field, and with a prime number of \(2^{255} − 19\). The output is a single x co-ordinate point and the base point is x = 9, with an order of \(2^{252}+27742317777372353535851937790883648493\). Curve 25519 is used in many applications including with TLS 1.3, OpenSSH, SmartFTP, Tor, SAFE (created by Maidsafe), Signal, WhatsApp, and Facebook Messenger.

## Curve 25519 with Go |

## Coding

package main import ( "golang.org/x/crypto/curve25519" "math/rand" "fmt" "time" ) func main() { rand.Seed(time.Now().UnixNano()) var privateKey [32]byte for i := range privateKey[:] { privateKey[i] = byte(rand.Intn(256)) } var publicKey [32]byte curve25519.ScalarBaseMult(&publicKey, &privateKey) fmt.Printf("\nPrivate key (n):\t%x\n",privateKey) fmt.Printf("\nPublic key point (x co-ord):\t%x\n",publicKey) }

A sample run is:

Private key (n): 9b3988a988b1137f17c4975ae3a4bf030a75fa09e8dbdee61e60b1ee5a1b3c4e Public key point (x co-ord): 08480a9926b558661d135d059748a068ce68c772f55a9ab4f532b313e6aa925a