readium / readium-lcp-client

This repository is for the Readium Licenced Content Protection (LCP) client side implementation work.
BSD 3-Clause "New" or "Revised" License
16 stars 12 forks source link

AES-256-GCM decrypt partial buffer at random access location in cypher text (HTTP byte range requests, video/audio) #22

Open danielweck opened 7 years ago

danielweck commented 7 years ago

Original Pull Request: https://github.com/readium/readium-lcp-client/pull/21#issuecomment-270337169

danielweck commented 7 years ago

See Decrypt() where bool full is false (partial byte range request): https://github.com/readium/readium-lcp-client/blob/feature/lsd/src/lcp-client-lib/AesGcmSymmetricAlgorithm.cpp#L125

danielweck commented 7 years ago

More specifically, see CryptoPP IsRandomAccess. https://github.com/weidai11/cryptopp/issues

Pipelining: https://www.cryptopp.com/wiki/Pipelining

danielweck commented 7 years ago

GCM is similar to CTR mode, which means that the IV can be computed at any random offset by incrementing the counter. https://www.cryptopp.com/wiki/CTR_Mode#Seeking