Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

By encrypt in place I mean the following. Suppose I have an input plaintext of length L and I have also allocated an extra E bytes at the start and/or end of the buffer, with E << L. So the length of the input buffer is L+E and I'd like to use the same buffer for output (the encrypted data). I understand some fixed expansion may be necessary but supposing the buffer is megabytes to begin with; then that extra amount is negligible.

I'm wondering which AES-GCM implementations (preferably those that are hardware-accelerated (e.g.: AESNI, VPAES, QuickAssist)) will allow for the encryption to take place all within the original buffer without allocation of considerable additional memory (beyond the L+E total). Similarly, I'd like an encrypted buffer to be given (with additional bytes allocated, as before) and I'd like the plaintext to be decoded in-place.

Do any implementations support this? Can they be adapted to do so very easily? Specifically, what about crypto++ or OpenSSL?

share|improve this question

closed as off-topic by e-sushi, AFS, DrLecter, rath, Gilles Mar 7 '14 at 21:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

This question might get closed - it's a combination of two different out-of-scope topics, namely reference requests and questions about specific crypto libraries. You'd probably have better luck on Stack Overflow or Security SE. – pg1989 Mar 6 '14 at 20:45

Browse other questions tagged or ask your own question.