63 lines
1.4 KiB
Markdown
63 lines
1.4 KiB
Markdown
|
|
# pads
|
|
|
|
Pads is an implementation of a simple one time pad algorithm.
|
|
There are 5 programs, two pairs of server client programs and
|
|
one program to generate random keys.
|
|
|
|
The client validates the input and sends it to the server in
|
|
a chunk of 70001 chars. The server receives that; one for the
|
|
text and one for the key. The server encrypts the text with
|
|
the super special algorithm and then returns the encrypted or
|
|
decrypted text in another 70001 byte TCP stream.
|
|
|
|
To handle multiple connections, the process forks, does the transfer
|
|
encrypts the message, sends the text, and then kills the process.
|
|
The main process waits for the dead processes after receiving new
|
|
connections.
|
|
|
|
|
|
## Compiling
|
|
|
|
It is highly recommended to use the make command to compile the
|
|
5 required programs.
|
|
|
|
Simply type:
|
|
|
|
```
|
|
make
|
|
```
|
|
|
|
## Running
|
|
|
|
### servers
|
|
|
|
dec and enc server's both require the port to be specified as a
|
|
launch argument:
|
|
|
|
```
|
|
./enc_server 69
|
|
./dec_server 420
|
|
```
|
|
|
|
consider running them in the background with '&' and choosing ports
|
|
greater than 1024.
|
|
|
|
### clients
|
|
|
|
The clients communicate with their respective servers **only**. To
|
|
connect, you specify the password file, key file, and port as launch args:
|
|
|
|
```
|
|
./enc_client plaintext_file key_file 69
|
|
```
|
|
|
|
### keygen
|
|
|
|
The keygen program takes the number of characters as a launch argument:
|
|
|
|
```
|
|
./keygen 69
|
|
```
|
|
|
|
consider redirecting output with `> somefile`
|