https://github.com/kimjungwow/tcp-socketprogramming-vigenerecipher
A string encryption service with Socket API
https://github.com/kimjungwow/tcp-socketprogramming-vigenerecipher
network socket-io
Last synced: 2 months ago
JSON representation
A string encryption service with Socket API
- Host: GitHub
- URL: https://github.com/kimjungwow/tcp-socketprogramming-vigenerecipher
- Owner: kimjungwow
- Created: 2019-09-07T10:24:42.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-09T11:43:09.000Z (over 6 years ago)
- Last Synced: 2025-10-19T01:58:03.017Z (8 months ago)
- Topics: network, socket-io
- Language: C
- Homepage:
- Size: 133 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TCP Socket Programming (Vigenère cipher) :computer:
- Implement a connection-oriented, client-server protocol based on a given specification (TCP sockets)
- Send/receive data via socket
- Implement a string encryption/decryption service : [Vigenère cipher](https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher)
## Components :memo:
- client.c : Communicate with the server based on the specifcation.
- server.c : Communicate with multiple clients using fork().
- server_select.c : Communicate with multiple clients using select().
## How to compile? :walking:
`make all : compile all of three source codes`
`make client : compile client.c`
`make server : compile server.c`
`make server_select : compile server_select.c`
`make clean : remove all object files and binary files.`
## How to run? :runner:
#### Make 50MB text file
`tr -dc A-Za-z0-9 test.txt`
#### Run server (server_select)
`server -p [PORT]` or `server_select -p [PORT]`
#### Run client
`./client -h 127.0.0.1 -p 7878 -o 0 -k abcd < test.txt > a.txt`
`./client -h 127.0.0.1 -p 7878 -o 1 -k abcd < a.txt > b.txt`
`diff -i test.txt b.txt`
#### Run multiple clients
##### Make shell scripts like below and execute
```
for i in {1..20} ;
do
./client -h 127.0.0.1 -p 7878 -o 0 -k abcd < test.txt > a$i.txt &
done
```
## Others :+1:
- I studied socket programming through this link.
So I wrote code related to socket programming such as send() or getaddrinfo() referring to this link.
https://beej.us/guide/bgnet/html/single/bgnet.html
- Testcases in `testvectors` directory are encrypted with keyword `abcd`