Git Product home page Git Product logo

diffie-hellman-golang's Introduction

diffie-hellman-golang

I tried to implement the diffie hellman key exchange in golang with the use of sockets to understand how this protocol works and to learn golang. So its a development project: obviously don't use it in production.

Installation

Run go get to download the needed dependencies.

Run

Run this with go run . You need to set the following command arguments:

Name Help
-m or --mode mode of diffie hellman server or client
-a or --address the listen address or address of the server

How it works

After the connection between the server and client is established the client will generate the public numbers p and g. p is a primnumber and g is lower than p. The client also generates/calculates his secret s and public key. The secret is smaller than p and the public key is g ^ s mod p. After the server received the public information he generates/calculates his secret and public key as well. He sends his public key to the client and the client sends his back. Both sides calculate the shared secret: The public key of the other partner ^ the own secret s mod p. The clients generated a shared secret asymmetricaly.

diffie-hellman-golang's People

Contributors

adridevelopsthings avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

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.