encrypt files

0

I would like to know if there is any way to encrypt videos , images , etc. ... without being just text, with PHP, SQL , some language WEB , I want to do something that keeps file security, which if the person is to download will receive a totally useless file for it

    
asked by anonymous 07.11.2017 / 03:33

1 answer

1

According to your answer for wanting to transmit encrypted video in the same way as NetFlix, I believe your need can not be done by cryptography in PHP.

Netflix, iTunes, Amazon Prime Videos, Globo Play, etc. are referral services in the use of DRM (Digital Rights Management) for protection of their contents. After all, the big Hollywood studios do not want their movies to be downloaded and distributed so easily through these new paid on demand video services.

DRM was a solution found to minimize and protect the illegal downloading and distribution of media, such as audio and video.

Basically, videos that work with DRM are encrypted and require a license to run. The big difference here is that, unlike HLS (HTTP Live Streaming) with encryption, the license is sent directly to a Content Decription Media (CDM). CDM is usually installed by default in browsers so that they are able to decrypt DRM-protected files.

Todaywehave3majorCDMsonthemarket:

  • Widevine,whichisusuallyinstalledbydefaultinGoogleChrome,Firefox,Opera,etc.
  • PlayReady,andisthesolutionusedbyMicrosoftEdgeforexample.
  • FairPlay,usedspecificallybySafari.
  • ThemostinterestingpartoftheprocessishowDRMgeneratesthislicense,allowingaparticularusertowatchcontent.Inasimplifiedwaywehave:

    EachvideoinMPEG-DASHformathasa"manifest file" having the key that was used to encrypt its fragments. Usually this file has the extension "mpd".

    When a video playback request is made, the browser sends the video data to the server plus the specific information of the user requesting the license. The DRM server makes a request back to the application server "asking" whether the user is allowed to see that video specifically. The application server responds YES or NO. If so, the DRM server issues (issue) the license that is passed to the CDM of the browser and the video is finally reproduced.

    This means that if you download all the fragments of the MPEG-DASH files, you will not be able to decrypt or even get the "certificate" as it does in HLS. The only way to get the license is through DRM authentication.

    The big disadvantage of DRM is that it is an expensive solution, mainly because we need at least 3 companies to provide this service: Google, Microsoft and Apple.

    Source with more information: link

    In this link you will also have more information about how to protect and encrypt these videos:

    link

    I hope I have helped.

        
    07.11.2017 / 22:45