Check for invalid input in encrypted buffers