I have the code below to encrypt and decrypt file with botan in Qt. When encrypt big files it spend a lot of time, and i want to get the number of processed bytes when encrypting/decrypting big files. Is it possible?
void AES::Encrypt(SymmetricKey key, InitializationVector iv, string inFilename, string outFilename)
{
std::ifstream in(inFilename.c_str(),std::ios::binary);
std::ofstream out(outFilename.c_str(),std::ios::binary);
Pipe pipe(get_cipher("AES-256/CBC", key, iv,ENCRYPTION),new DataSink_Stream(out));
pipe.start_msg();
in >> pipe;
pipe.end_msg();
out.flush();
out.close();
in.close();
qDebug() << "Encrypted!";
}
void AES::Decrypt(SymmetricKey key, InitializationVector iv, string inFilename, string outFilename)
{
std::ifstream in(inFilename.c_str(),std::ios::binary);
std::ofstream out(outFilename.c_str(),std::ios::binary);
Pipe pipe(get_cipher("AES-256/CBC", key, iv,DECRYPTION),new DataSink_Stream(out));
pipe.start_msg();
in >> pipe;
pipe.end_msg();
out.flush();
out.close();
in.close();
qDebug() << "Decrypted!";
}