For example, when using CTR mode, I can use something like the following code fragment to randomly seek to a position in a data buffer:
CryptoPP::CTR_Mode<CryptoPP::AES>::Encryption encryptor;
encryptor.SetKeyWithIV(key, sizeof(key), iv);
encryptor.Seek(startPosition);
encryptor.ProcessData(out, in, length);
This works very nicely but I would like to use GCM instead.
Can I therefore do something like the following?
CryptoPP::GCM<CryptoPP::AES>::Encryption encryptor;
encryptor.SetKeyWithIV(key, sizeof(key), iv);
encryptor.Seek(startPosition);
encryptor.ProcessData(out, in, length);
As you can probably tell, I'm not a cryptographer.
Many thanks,
Ben.