这是indexloc提供的服务,不要输入任何密码
Skip to content

tesuji/godhchat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple encrypted chat with Diffie-Hellman key exchange 💮

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages