Just to speed things up a little more...

* Thus wrote Marcel Tschopp:
> ...
>     $key = GenerateKey($hash);
>     $keylen = strlen($key = implode('', $key));
> 
>     $handle = fopen($filename, 'r');
>     while (!feof($handle))
>     {
>       // Set the time limit or the script will time out
>       // on large files
>       set_time_limit(30);
> 
>       $data = fread($handle, 8192);

        // read in the $keylen amount
        $data = fread($handle, $keylen);

>       for ($i = 0; $i < strlen($data); $i = $i + $keylen)
>       {
>               $data = substr_replace($data, substr($data, $i, $keylen) ^ $key, $i, 
> $keylen);
>       }
> 
>       // Return the encrypted version to the browser
>       echo $data;

        // then all the above becomes usless..
        echo $data ^ $key


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to