don't write file if opening a stream to encrypt the data fails