Search code examples
javavideoencryptionlive

Live Video Encryption in Java


I want to make a java project on streaming video encryption. Where i will use two PCs 1 act like a media server and other act like a client. So a video file (example.avi) in server pc can be view by client pc.

I already worked with sockets and can send files over a LAN. But here my question is -> I want to send the encrypted video Stream to the client PC and the Client then display the video.

The process is like:

  • Client request a video file
  • Server open the video file (in text mode or something else) and start encrypting and sending to client.
  • Now client start receving and decrypting the data.
  • And display the decrypted data as video in details Server
  • Connected to client
  • Open the video file
  • While Not EOF
  • Read file content block
  • Encrypt it
  • Send encrypted block to the client
  • End While Client
  • Connected to server
  • While True(Or something like that)
  • Store the received encrypted data
  • Decrypt it
  • Display it as video
  • End While

I do not need any source code for that. I just want to know that from where i can start this project. Any suggesstion will be helpful for me.

  • Can connect two pc
  • Can read files
  • Can encrypt
  • Can send data over LAN
  • Can decrypt it

But how can i use the decrypted data and display it as video?


Solution

  • You don't have to reinvent the wheel here, because there is already a standardized technology to encrypt communication over TCP/IP: Transport Layer Security.

    Check out the classes SSLSocket, SSLServerSocket, SSLSocketFactory and SSLServerSocketFactory. They behave just like the normal Socket classes (they extend them, so you don't even have to change the type), but they encrypt the data under the hood and decrypt it transparently when received without you having to do much.