sheffin has asked for the wisdom of the Perl Monks concerning the following question:

This is my puzzle :
I need to stream a video which is present on server say xyz.com. If i access the correct path of the video everyone is able to see that video. What i need to do is that create a MD5sum corresponding to the every particular video which has an unique video id. So that from now onwards if the user is accessing the video as before ie : it should not load for the below. http:/xyz.com/video.mp4 It should load only for the following url http:/xyz.com/video.mp4?md5=202cb962ac59075b964b07152d234b70 Any suggestions? Thanking all in advance
  • Comment on How to assure security in the lighttpd (lighty) for a video streaming ?

Replies are listed 'Best First'.
Re: How to assure security in the lighttpd (lighty) for a video streaming ?
by marto (Cardinal) on Jul 03, 2012 at 12:31 UTC

    Which part are you having problems with? Generating (see Digest::MD5) and storing the checksum or querying it before serving a file?

      I am able to successfully get md5sum value.
      The issue is that when a request is made to the lighttpd how can i get the url requested so that i coudl verify the url. how will i be able to get the url which calls the video so that i can make sure the security .
      If the expected md5sum is present in the url i will allow video to play else will not stream the video
Re: How to assure security in the lighttpd (lighty) for a video streaming ?
by onelesd (Pilgrim) on Jul 03, 2012 at 23:22 UTC

    This will not be secure at all if you are using auto-increment or similar to generate the IDs for your videos.

    What you could do instead (which isn't totally secure, but more-so at least), is use Data::UUID and Digest::SHA1.

    After the video has been accessed, generate a random UUID, then run it through sha1 to make it prettier. Then just rename the video to the sha1 value you got.