Giter Site home page Giter Site logo

gunnar-stunnar / dhecc Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 2.0 8 KB

Diffie Hellman Elliptic Curve Key exchange automated Encrypting system using AES

License: MIT License

Python 100.00%
encryption aes ecc python2 fun exciting diffie-hellman keyexchange key exchange messaging public-key-cryptography fun-for-the-whole-family

dhecc's Introduction

DHECC

Diffie Hellman Elliptic Curve Key exchange automated Encrypting system using AES. This was a fun side project to get to play with encryption and practice Python.

Built With

How To Use

First add the Imports.

import Encryption
import os # optional if you want to generate your own keys.

Next both partys create a Random key that is 32 bytes long.

random_key1 = os.urandom(32) # os random provides a more securely generated value.
random_key1f = int(("".join("{:02x}".format(ord(c)) for c in random_key1)), 16)

# party 2
random_key2 = os.urandom(32)
random_key2f = int(("".join("{:02x}".format(ord(c)) for c in random_key1)), 16)

After this the both partys making use of this will instantiate the AESCipher class in Encryption and pass the randomly generated key to it.

# party 1 
party1 = Encryption.AESCipher(random_key1f)

# party 2
party2 = Encryption.AESCipher(random_key2f)

Once this is done both partys will then obtain their public keys and send them to each other.

# party 1 
party1_pubKey = party1.getPubKey()

# party 2 
party2_pubKey = party2.getPubKey()
# party 1 
party1.DHEC(party2.getPubKey())

## party 2
party2.DHEC(party1.getPubKey())

After this then both partys are able to start encrypting

ent1 = part1.encrypt("howdy" + " " + 128*",")
print(part2.decrypt(ent1))

ent2 = part2.encrypt("howdy2")
print(part1.decrypt(ent2))

Disclaimer

I am not fully done with this and will not be held responsible if their are any found vulnerability in it that are exploited on your application. PLEASE, send me a message if you see any vulnerability

THANK YOU

dhecc's People

Contributors

gunnar-stunnar avatar

Stargazers

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