I'm using password base encryption, and trying to encrypt large data. The data gets streamed in via getInputStream of ServletInputStream. The data is being received as 64k byte chunks at a time which I need to encrypt and send it to an output file say "outFile.txt". Now if the data streaming in is much greater than 64k bytes, is it possible that I can receive the second chunk of 64k, and encrypt it and append it to the file contents of "outFile.txt". Does it cause any errorneous encryption results ?
Is it possible to do it in the above manner ? Can you give me any examples?
Or can I save the incoming data in a temporary file "temp.txt", and then encrypt it in one go - saving it to "outFile.txt", and then delete "temp.txt". Having "temp.txt" might be a compromise on security ? But I am not able to find any other option.
thanks. -Sara [ June 09, 2006: Message edited by: Sara James ]