Manual decryption of (old?) files from external storage

Nextcloud version (eg, 20.0.5): 23.0.0
PHP version (eg, 7.4): 7.4

Hello,

As I was browsing support forum I see that major versions are released but encryption feature stays as immature as it was years ago. OK, forgive me my bitterness, I am just tired of all that kung-fu.

So, I had external folder where I had some files. Some were already there at the moment I attached storage, some I added. Encryption was ON. I do not remember which version I had, maybe 16, maybe 17. Some time ago I upgraded my instance all the way to 23. And recently I realized some of encrypted files were not properly converted. I cannot say if rest was converted or if they were not encrypted at all, I know that now I have several files I cannot access. Unfortunately, 1-2 of them are really important for me and I would like to restore them.
Opening in webapp does not work, I have error 500 and error in logs “Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.”
With one file I tried to copy or delete etc, so probably system lost knowledge it is encrypted and now it opens normally as a encrypted content - that’s I want to use ‘external’ way.
Could it be related to fact I changed my password in the meantime? It would be weird.

So, I have encrypted file (content is like “HBEGIN:oc_encryption_module:OC_DEFAULT_MODULE:cipher:AES-256-CTR:signed:true:HEND”…).
I have content of data/files_encryption/ folder:
OC_DEFAULT_MODULE with master_, pubShare_ and recoveryKey_ files
keys/files where i have OC_DEFAULT_MODULE with fileKey and user.shareKey files
These files seems to be in old(?) format - small size and binary content, not hex like for new files.

Is there any way how may I manually decrypt my files? Some script, openssl command, whatever?
Do not tell me to use “occ”, I played dozen times with encryption: enable, disable, scan, migrate etc. Still files are encrypted.

Thanks for any suggestion.

Do you still have the whole data folder and config file in addition to the external storage folder? Then you could try to decrypt the files outside of Nextcloud with this standalone script: https://github.com/syseleven/nextcloud-tools/blob/master/rescue/decrypt-all-files.php