Currently it is not possible to export the encrypted data.
Attachments: The workaround is to decrypt all the attachments firstly before exporting them.
CustomFields: There is no way to decrypt encrypted custom fields so it is totally impossible to export or migrate them to a different Jira instance.
We could offer the ability to migrate the encrypted data without having to decrypt it.