Clean up cipher codec for maximum speed and minimal memory copy.