• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Encrypting a few bytes of data at a time

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic