Here is a simple java program which can be used to send and receive encrypted files over network. The sender encrypts the file before sending and the receiver decrypts the file and displays it. The program is based on a networking lab experiment at my college. So, although we say 'encryption', characters are simply incremented here. The lab question was as follows:
A client wants a file that is with a server in a secure system. The server encrypts the file in such a way that 'A' will be replaced with 'B', 'B' with 'C'... and 'Z' with 'A' and sends to the client. The client should get file and decrypt it to the original one and display the content. Implement it using TCP/IP.
Tutorials, tips and tricks about java programming language. Answers for many doubts about java programming language. Answering many howtos. Sample java projects and source code, java games, java programs for java practical labs.
Search This Blog
Showing posts with label file transfer. Show all posts
Showing posts with label file transfer. Show all posts
Java Program to Send Image between Computers using UDP and Display it
Java program to send image file over network using UDP |
picture (image) from a computer to another via network using UDP protocol and to display it at the receiving end. Simply, this is the java code to make a java application which can send images from one computer to another over a network. The program uses UDP (User Datagram Protocol). For both the computers (on either ends) the same code is enough. This app can act as a image sender or a receiver. The program uses a Progress bar (JProgressBar) to show the progress of the data transfer. Remember, transferring files over UDP is not easy because UDP does not guarantee ordered delivery, and not even successful delivery. So, here in this program, to ensure ordered delivery, the sender sends next chunk of data (DatagramPacket) only after receiving an acknowledgement for last sent packet. For acknowledgement, i used a string "ACK".
Subscribe to:
Posts (Atom)