Coder Social home page Coder Social logo

kanika2296 / elliptic-curve-diffie-hellman Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 5.0 4 KB

Implemented in python , Elliptic-curve Diffie–Hellman (ECDH) is a key agreement protocol that allows two parties, each having an elliptic-curve public–private key pair, to establish a shared secret over an insecure channel. This shared secret may be directly used as a key, or to derive another key

Python 100.00%
python python3 elliptic-curve-cryptography elliptic-curve-diffie-hellman elliptic-curve-arithmetic elliptic-curve-sum elliptic-curve-points

elliptic-curve-diffie-hellman's Introduction

Elliptic Curve Diffie Hellman

Implemented in python , Elliptic-curve Diffie–Hellman (ECDH) is a key agreement protocol that allows two parties, each having an elliptic-curve public–private key pair, to establish a shared secret over an insecure channel. This shared secret may be directly used as a key, or to derive another key.

How it works

  1. Takes input , curve and a point on curve
  2. Check if point lies on the curve
  3. Inputs second point

Functions

  1. Calculate sum of two points on ECDFH
  2. Encrypt a message Encrypts a input message, with input generator and private key
  3. Generate public key
  4. Decrypt a message
  5. Print all points on the curve

How to run

#Enter a : 0  // y^2 = x^3+ax+b
#Enter b : -4
#Enter p : 257 // mod 
#Enter x : 0  // x cordinate of point
#Enter y : 1  // y cordinate of point
#Check if point lies on the curve ?
#False
#Adding points: 
#Enter xq: 3  // x cordinate of second point
#Enter yq: 10  // y cordinate of second point
#Sum : 
#(6, 238)
#Enter message(x,y) point x : 112  // message (m,m2)
#Enter message(x,y) point y :26
#Enter na (private key): 101  // private key
#Enter generator (i,j) cordinate i : 2  // generator (g,g)
#Enter generator (i,J) cordinate j : 2
#Encrypted message: 
#((136, 128), (246, 174))
#Decrypted message: 
#(112, 26)
#All Points on the curve are :

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.