AES encrypt extra close on write