I'm currently writing an encryption program designed to read in a file (and
encrypt it) by splitting it in to 128 byte block segments and encrypting
each segment iteratively. The problem is is that it works fine up to sizes
of approx 8.5MB (albeit the program slows down throughout the process) and
then crashes at 8.5 leaving me to have to reboot my computer (linux).
Here is the pseudo-code:
whilst not eof
{
read in 128 bytes from file, stick in to inBytes[]
encrypt inBytes[], stick reult in to outBytes[];
write outBytes to disk[];
iterate put stream pointer by 128;
iterate get stream pointer by 128;
}// end of encryption process
delete[] inBytes;delete[] outBytes;
Do you think its a memory (de)allocation issue with inBytes and outBytes. If
so, does any one have any suggestions how I can sort it out?
Thanks
Ben