I'm trying to encrypt/decrypt a file using AES 256 bit with the code I got from here. The full code I am using is seen here. I was wondering how I could calculated the percentage done of both encryption/decryption in the while loop as it writes to the file. For example in encryption:
while ((read = fsIn.Read(buffer, 0, buffer.Length)) > 0)
{
cs.Write(buffer, 0, read);
//int percentage = Calculate percentage done here?
}
And in decryption:
while ((read = cs.Read(buffer, 0, buffer.Length)) > 0)
{
fsOut.Write(buffer, 0, read);
//int percentage = Calculate percentage done here?
}