How to best import users from legacy application with algorithm: 'aes-256-cbc'?

Hi. I’m looking for a way to move a user accounts to Keycloak. The system which currently holds the user data will be shut down after. If I understand correctly, this could be done with user federation (https://www.keycloak.org/docs/latest/server_admin/#_user-storage-federation ) with a provider that stores all data in Keycloak’s database?
In the old system, the passwords were hashed with aes-256-cbc…