chat

command module
v0.0.0-...-36f1bc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2021 License: MIT Imports: 16 Imported by: 0

README

chat

A simple terminal chat with e2e twofish or blowfish encryption over UDP

Sample Dession

Features

  • Diffie Hellman key exchange
  • Blowfish and Twofish e2e encryption
  • UDP transport
  • Simple Terminal UI

Some future improvements:

  • Better Terminal UI using tview
  • p2p support with UDP hole punching
  • Option to use blowfish or other symetric encryption algorithms

Installation

$ go get -u git.mills.io/prologic/chat

Usage

Waiting for a peer:

chat

By default binds to UDP port :1337.

Connecting to a peer:

chat x.x.x.x:1337

Sample

Here is a sample session between two clients (//on localhost//) to demonstrate the exchange as well as the packets on the wire captured via ngrep:

Listening client:

$ ./chat
>>> <prologic> hello
^D

Connecting client:

$ ./chat -b :1338 127.0.0.1:1337
>>> hello
>>> ^D

Packet dump:

$ ngrep -q -W byline -d lo0 '.*' 'udp port 1337'
interface: lo0 (127.0.0.0/255.0.0.0)
filter: ( udp port 1337 ) and (ip || ip6)
match: .*

U 127.0.0.1:1338 -> 127.0.0.1:1337 #1
{"kind":1,"addr":"","user":"prologic","data":""}

U 127.0.0.1:1338 -> 127.0.0.1:1337 #2
{"kind":2,"addr":"","user":"prologic","data":"xQb8sVksIlv701Xc0qeYZdkFMLNBgjPhkqzY1fQf1B5vSzERJ0Y6JzbEeqHSaDIdBrK3P6M8PNcVpRd5SDDNeIMz5E7lShsx4h3JXp7Z6YsmDVSj+f+DmKF+nm49g20uUICMzoAJ5jNiD+anqtvz847W6fdY2WGiS0gbF37b/4ZD2L47XwmMIL+Gumu/9xSH/2TC7uSbpfDjNdF2+kJtZIToBSvC4ZEVEPceSsg+/gHjbx7WUlU2Gk55eGRHhLxVyxRjZslCSFv6nH+ypr6++VigwtP/emCX6Ow1Cm0p6g/kHbW6kos3srMHTiBvsASn2D3+G3syNZTCkQ0YhDWWaw=="}

U 127.0.0.1:1337 -> 127.0.0.1:1338 #3
{"kind":2,"addr":"","user":"prologic","data":"A0kuKyl5aFh+voSng4SGfE/BLQSHlhrQwv4V7q8SFgg6vTzWRkLMvauY6siIvO+1h5USRaf9mLBofWIw7EpKgipZLsugSLj9hTBaxh0QFu0B4lEGQ3QyYOkJYwlITlmwO6vzV8saXaaromdL26H3FfWcxGIjvEgPTZnUELF0EXHiNHqSAc/X0k7BGeWDXHwaOJktqgVUvj267ai0hsDP2UcWFVkwnNiwHQgzudAQOGsqTILtd0D3ozDJ6mF7F2pwStpSpf5KzKVbcvFJSQr7GuBepMhHjWrzlOhAjP74I6D6gp7kWA/8sxQCKed48hHj/b82+DW1LQWFoIdQeKgN9g=="}

U 127.0.0.1:1338 -> 127.0.0.1:1337 #4
{"kind":2,"addr":"","user":"prologic","data":"xQb8sVksIlv701Xc0qeYZdkFMLNBgjPhkqzY1fQf1B5vSzERJ0Y6JzbEeqHSaDIdBrK3P6M8PNcVpRd5SDDNeIMz5E7lShsx4h3JXp7Z6YsmDVSj+f+DmKF+nm49g20uUICMzoAJ5jNiD+anqtvz847W6fdY2WGiS0gbF37b/4ZD2L47XwmMIL+Gumu/9xSH/2TC7uSbpfDjNdF2+kJtZIToBSvC4ZEVEPceSsg+/gHjbx7WUlU2Gk55eGRHhLxVyxRjZslCSFv6nH+ypr6++VigwtP/emCX6Ow1Cm0p6g/kHbW6kos3srMHTiBvsASn2D3+G3syNZTCkQ0YhDWWaw=="}

U 127.0.0.1:1338 -> 127.0.0.1:1337 #5
{"kind":0,"addr":"","user":"prologic","data":"AAAAAAAAAAAAAAAAAAAAAMstXJjAO53FHrxEXdaMLQc="}
^C

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL