The process of message encryption and decryption during client-server communication using UDP server is as follows:
- The client requests the server with a file name.
- The corresponding file is opened by the server and sends the file using datagram socket.
- The sender sends the encrypted text (Xoring) with a fixed length key.
- The receiver receives the encrypted text (cipher text).
- The receiver decrypts the file using the same key (private key).
Prerequisite : Socket Programming
Input : file.txt Output : ClientSide : Received from server: 00 2C 28 28 2A 6E 3B 24 37 64 65 79 0A 00 00 Decrypted message: Hello People ServerSide : Encrypted message stored in file: 00 2C 28 28 2A 6E 3B 24 37 64 65 79 0A 00
Client Side Program:
Server Side Program:
- IPC using Message Queues
- Print colored message with different fonts and sizes in C
- TCP Server-Client implementation in C
- UDP Server-Client implementation in C
- Reverse a string in C/C++ using Client Server model
- Socket Programming in C/C++: Handling multiple clients on server without multi threading
- X-Macros in C
- What does main() return in C and C++?
- SDL library in C/C++ with examples
- Why to use fgets() over scanf() in C?
- Thread functions in C/C++
- How to Compile and Run C/C++/Java Programs in Linux
- How to get the current position of cursor from output screen in C?
- Computer Networks | Set 14
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.