This is a simple, proof of concept implementation of three-pass protocol encryption. The encryption works as follows:
- Sender multiplies every byte of its message by its key into a long
- Sender sends the modified message to the receiver
- Receiver multiplies every long of received message by its key
- Receiver sends message back to sender
- Sender divides every long of message by its key
- Sender sends message back to receiver
- Receiver divides every long of message by its key.
- The message is now in plaintext at the receiver's end.
Just call make:
$ make
To start the receiver:
$ ./receiver <port> <key>
To start the sender:
$ ./sender <host> <port> <key>
The sender accepts exactly one line of input from stdout, sends it, and exits.