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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -