Giter Site home page Giter Site logo

elliptic-curve-compute's Introduction

elliptic-curve-compute

Basic elliptic curve calculation for experiment and learning.

This simple python code will allow you to define an elliptic curve on the prime-field of your choice. It will allow you to display :

  • all the valid points (matching elliptic curve on the field)
  • use a valid origin point O to generate the sub-group of points using the scalar multiplication P=k.O (k varying from 0 to order of the sub-group)

As an example, Bitcoin is using same method to generate the public key (with much bigger integer than this program can handle) :

  • O is the origin point : 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798,0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8
  • Elliptic curve is y^2 = x^3 + 7 on the field 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F
  • k is the scalar multiplicator (private key) : number that can be between 1 and 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 (order of generated sub-group)
  • P are the coordinates of the resulting point (and giving your public key)

The private/public address are derived from those datas. Security is mainly done by the fact that given a known public key (resulting P=k.O) you cannot guess the value of k (the private key). There are no other ways than brute force (trying as many k as needed and compare with P), and the size of number involved make impossible to check them all during a scan taking several zillions of universe age with all humanity computers working together (in fact this is in reality much longer than that ... but you get the idea).

Here is an example of display for the curve y^2=x^3+7 over the field F17 (finite field with prime=17) : image

Here is the displayed graph for a generated sequence on this curve with origin = (6,11) : image

Here is the displayed graph for a generated sequence on this curve with another origin = (15,13) : image

elliptic-curve-compute's People

Contributors

oliviergaland avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

knox66

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.