Git Product home page Git Product logo

secure_channel_chat's Introduction

secure_channel_chat

copyright 2013 Kevin Dean

Test implementation of a secure channel based chat system.

The protocol is as follows:

Client enters '/connect domain' to connect to domain.

Client and server are each prompted for a shared passphrase.

Each side picks a random 256-bit number, encrypts with the passphrase, then they trade (the server sends first)

Boths sides xor the two numbers together to create the shared key.

Four keys are created, enc_send, enc_recv, auth_send, and auth_recv, each is the hash of the shared key with a string identifying the purpose.

On the client-side, send/recv keys are swapped.

Communication begins.

For each message sent, the data is encrypted under enc_send, then the ciphertext is appended to the message number and hashed under HMAC with auth_send as the key. Both portions are sent.

For each received, the first 64 characters are called the authenticator. The remainder is combined with the message number and hashed under HMAC with auth_recv as the key.

If the authenticators match, the remaining received text is decrypted under enc_recv.

If a message is a tuple/list, it is joined using the hex byte \x02, then split by that byte on reception at the other end.

This makes \x02 unusable in communication, but as it is the ASCII start_of_text byte, this should not be a problem.

secure_channel_chat's People

Contributors

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