Recover encrypted files

Hi guys,

My nextcloud server is down recently. The web interface shows an internal server error message. I decided to rebuild the server only to find out that the user data are all encrypted using the nextcloud default encryption module. I have the keys for all single files but I dont know how to decrypt the files without the web interface. Please HELP!!

I am running nextcloud 16.0.4 on centos 7. Please ask if I need to provide any documents or log!

Thanks everyone.