https://github.com/cxspxr/dhell
Diffie-Hellman Key Exchange in NodeJS
https://github.com/cxspxr/dhell
chat diffie-hellman diffie-hellman-algorithm end-to-end end-to-end-testing example javascript js nodejs simple
Last synced: 3 months ago
JSON representation
Diffie-Hellman Key Exchange in NodeJS
- Host: GitHub
- URL: https://github.com/cxspxr/dhell
- Owner: cxspxr
- License: mit
- Created: 2018-03-04T21:50:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T02:56:46.000Z (over 1 year ago)
- Last Synced: 2025-02-02T11:43:26.646Z (5 months ago)
- Topics: chat, diffie-hellman, diffie-hellman-algorithm, end-to-end, end-to-end-testing, example, javascript, js, nodejs, simple
- Language: JavaScript
- Size: 11.7 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Diffie-Hellman Key Exchange Simple End-to-End Chat in NodeJS
Just a simple example of how `Diffie-Hellman Key Exchange` can be implemented in End-to-End Chat.## Installation
```bash
npm i
```## Usage
Make sure you have **free** `:3000` in order to run `express` server. Otherwise, change the `port` constant inside the `express.js`.```bash
node express.js
```## Routes
I've set up chat with `GET` routes, just to make things simple and to emphasize publicity of distribution channels.There are two participants called `alice` and `bob`. You can find them in `express.js` file.
So you can navigate to one of these URLs using the showcase with `axios` in `express.js`
or using your browser:* `/send/message/:from/:to/:message` - sends a message. `:from` is the name `alice` or `bob`
(or yours, if you set it up), `:to` is the name of **another** chat participant and the
`message` is the message
* `/send-public-key/:from/:to` - sends a public `Diffie-Hellman` key from `:from` (e.g. `alice`)
to `:to` (e.g. `bob`). This public key is then used to generate the common secret key, using
a private key
* `/inbox/:whose` - show an inbox of `:whose` (e.g. `alice`)## Logging
Also I am logging all things to the terminal, so you are able to not use your browser.