RE: [PHP] Big file encryption

2005-07-14 Thread Jay Blanchard
[snip] well I have a big file (around 12M), and I have to encrypt this file, and to decrypt some time after. How could I do? Is it possible to encrypt and decrypt a file line by line ? [/snip] Start with the manual at http://us2.php.net/manual/en/ref.mcrypt.php -- PHP General Mailing List

Re: [PHP] Big file encryption

2005-07-14 Thread david forums
Hihihihi Of course I already has the whole object to encrypt and decrypt, my problem is link to the size of the file. There is no mcrypt function to load directly a file, so it's need to preload it in a variable and then encrypt or decrypt it. But when the file is 12M size it failed. So

Re: [PHP] Big file encryption

2005-07-14 Thread Mikey
david forums wrote: Hihihihi Of course I already has the whole object to encrypt and decrypt, my problem is link to the size of the file. There is no mcrypt function to load directly a file, so it's need to preload it in a variable and then encrypt or decrypt it. But when the file is

RE: [PHP] Big file encryption

2005-07-14 Thread Jay Blanchard
[snip] There is no mcrypt function to load directly a file, so it's need to preload it in a variable and then encrypt or decrypt it. But when the file is 12M size it failed. [/snip] What do you mean it failed? What kind of error did you get? -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Big file encryption

2005-07-14 Thread Ahmed Saad
hi david, On 7/14/05, david forums [EMAIL PROTECTED] 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');

Re: [PHP] Big file encryption

2005-07-14 Thread Skippy
Quoting Ahmed Saad [EMAIL PROTECTED]: // do whatever with the chuck you read. // you can encrypt it and write all the chunks to the same file But if you encrypt one chunk at a time and concatenate them later, or if you encrypt the whole thing, will you still get the same result? --

Re: [PHP] Big file encryption

2005-07-14 Thread Ahmed Saad
hi Skippy On 7/14/05, Skippy [EMAIL PROTECTED] wrote: Quoting Ahmed Saad [EMAIL PROTECTED]: // do whatever with the chuck you read. // you can encrypt it and write all the chunks to the same file But if you encrypt one chunk at a time and concatenate them later, or if you encrypt

Re: [PHP] Big file encryption

2005-07-14 Thread david forums
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 [EMAIL PROTECTED] a écrit: hi david, On 7/14/05, david forums [EMAIL PROTECTED] wrote: So I need to

Re: [PHP] Big file encryption

2005-07-14 Thread david forums
Not at all cause the chunk are beeing free every time it is write in the file. so it does not excide the amount you set. regards Le Thu, 14 Jul 2005 16:10:17 +0200, Skippy [EMAIL PROTECTED] a écrit: Quoting Ahmed Saad [EMAIL PROTECTED]: // do whatever with the chuck you read. //

Re: [PHP] Big file encryption

2005-07-14 Thread Skippy
On Thu, 14 Jul 2005 16:24:25 +0200 david forums [EMAIL PROTECTED] wrote: Not at all cause the chunk are beeing free every time it is write in the file. so it does not excide the amount you set. What I meant was that if the encryption algorithm inserts some magic info at the beginning of