php - Decrypt a video file and stream it to the client on the fly -
i running simple webserver stack php
, apache
. have system ram , disk space needed -- speed of course welcome not worry about.
i able have simple way read local encrypted video file (say, 256-bit aes), decrypt custom input, , send client (e.g browser) if simple video file.
i have no idea how start going this. if show me code sample great, if give few pointers happy.
i think use output buffering, again not sure. don't know crypto library use -- since apparently if typing word "mcrypt" code, doing wrong.
here pseudocode thought up:
$key = "[string key]"; $file = "/home/qnx/file.mp4.encrypted"; ($i = 0; $i < [file length]; $i++) { /* get, few bytes of file , decrypt them? dunno */ '... decrypt bytes ...' '... save buffer ? ...' /* send current buffer ? */ } '... close connection ...'
Comments
Post a Comment