Code Monkey home page Code Monkey logo

diffie-hellman-key-exchange's Introduction

Diffie Hellman Key Exchange

Go program that implements the Diffie-Hellman key exchange protocol at a 1024-bit key strength, this consists of parameter generation, share exchange, and key derivation. Normally the D-H scheme is an interactive protocol between two parties. However, for this implementation files are used as the communication channel.

DH-Alice 1

The first models Alice’s initial message to Bob, and outputs a secret key to be stored for later.

The program generates both public and private keys for Alice, this includes generation of prime number p using other prime numbers for its eulers totient \phi(p). The program can be executed as shown below:

dh-alice1 <filename for message to Bob> <filename to store secret key>

Outputs decimal-formatted public key ( p, g, ga ) for Bob and writes the secret key (p, g, a) to a second file.

DH-Bob

The second models Bob’s receipt of the message from Alice and outputs a response message back to Alice.

The program generates the public and private keys fro Bob and uses the private key and Alice's public key to generate the shared key. The program can bbe executed as follow:

dh-bob <filename of message from Alice> <filename of message back to Alice>

Reads in Alice’s message, outputs ( p, g, gb ) to Alice, prints the shared secret gab.

DH-Alice 2

The final program models Alice’s receipt of Bob’s response. For grading purposes you will hand in the following programs.

The program retrieves the previously generates secret key and Bob's pubblic key to generate the shared key gab. The program can bbe executed as follow:

dh-alice2 <filename of message from Bob> <filename to read secret key>

Reads in Bob’s message and Alice’s stored secret, prints the shared secret gab.

Hence both the parties were able to derive the shared secret key gab.

diffie-hellman-key-exchange's People

Contributors

arvindpj007 avatar

Stargazers

 avatar

Watchers

 avatar  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.