simple base for diffie hellman encrypted messaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lzu Tao fda473b819
listen on all interfaces instead of localhost
1 year ago
aescrypt various changes: * move from base64 Encode to EncodeString * use fmt.Fprintln instead of bufio.Writer.WriteString 1 year ago
dhchat listen on all interfaces instead of localhost 1 year ago
dhkx few changes: * change repo folder to godhchat * remove unused and debugging function 1 year ago
simple initial commit 1 year ago
.gitignore initial commit 1 year ago
LICENSE few changes: * change repo folder to godhchat * remove unused and debugging function 1 year ago
README.md fix readme and add known issues 1 year ago
main.go few changes: * change repo folder to godhchat * remove unused and debugging function 1 year ago

README.md

godhchat

Simple encrypted chat with Diffie-Hellman key exchange

Build

Clone this repo and go to cloned directory. Run go build to build the program.

If you want Windows Cross Compiling, run on Linux:

GOOS=windows GOARCH=386 go build

If you want to use Protocol Buffer (currently not used)

go get -u github.com/golang/protobuf/protoc-gen-go
export PATH=$PATH:$GOPATH/bin
protoc -I=./simple --go_out=./simple ./simple/simple.proto

Usage

Help menu:

$ ./godhchat --help
usage: ./godhchat [-h] [--port PORT] [--listen | --host HOST]

Diffie-Hellman Chat - encrypted chat with Diffie-Hellman key exchange

optional arguments:
  -host string
      IP address to connect to
  -listen
      listen to a port (Chat Server)
  -port uint
      port number for connection (default 6001)

[+] Written by 15520599

In server side, run:

./godhchat --listen

to open default port 6001 and listen on all interfaces. You can specify which port you want with option --port.

In client side, run:

./godhchat --host localhost

Replace localhost with server IP address if server did not run on local. Again, use --port to choose which port to connect to.

Example:

Use CtrlC to kill the program.

Server side:

$ ./godhchat --listen
Listenning on port: 6001
Connection from 127.0.0.1:56642
>>> asdf
<<< >>> good man

Client side:

$ ./godhchat --host localhost
asdf
<<< good man
<<< >>> ok

What Wireshark captures

Decode it:

$ echo -n 'UspNgg3ccUFF9SzYvcKJRumWyXJ49h-4oi8uR1lVk_GCOMTVoi2gXoJtT3tMvrM0' | base64 -d
base64: invalid input

Known issues

  • CtrlD hangs the program.

License

Released under MIT License

THANKS TO

Diffie-Hellman implementations

AES Encryption Example