how to encrypt a readfile($file) on the fly ?
| From: | Graham Anderson | Date: | Fri, 23 Sep 2005 19:53:31 +0000 |
| Subject: | how to encrypt a readfile($file) on the fly ? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-223094@lists.php.net to get a copy of this message | ||
is it possible to encypt a file dynamically as it is being readfile'd ?
I want to create a key stored in a db that decrypts the file once it reaches the user's computer.
This file is being progressively loaded...loads and plays at the same time
something like:
header("ETag: ".md5(time()));
header("Accept-Ranges: bytes");
header ("Content-Length: ".fileSize($file2Encrypt));
header("Content-Type: ".$mime);
readfile_whileEncrypting($file2Encrypt,MCRYPT_3DES));
is there a PHP function out there that can do this ?
g