You are here: Re: [PHP] Big file encryption « PHP « IT news, forums, messages
Re: [PHP] Big file encryption

Posted by "david forums" on 07/14/05 17:20

Ok tx

And you mean that I can concatenate every chunck in the same file ?

And what about decryption, could I take the same way ?

david

Le Thu, 14 Jul 2005 14:25:48 +0200, Ahmed Saad <myanywhere@gmail.com> a
écrit:

> hi david,
>
> On 7/14/05, david forums <dforums@vieonet.com> wrote:
>> So I need to know a way to be able to encrypt large file.
>
> function readfile_chunked ($filename) {
>
> $chunksize = 1*(1024*1024); // it reads 1 mb per chunck. adjust this
> if u need.
> $buffer = '';
> $handle = fopen($filename, 'rb');
>
> if ($handle === false)
> {
> return false;
> }
>
> while (!feof($handle))
> {
> $buffer = fread( $handle, $chunksize );
> // do whatever with the chuck you read.
> // you can encrypt it and write all the chunks to the same file
> // (open a file for writing before the loop)
> }
>
> return fclose( $handle );
> }
>
> -ahmed
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация