How to fix document encryption issue

The files on the system started life in version 5.0x. Then, the system was upgraded to 6.0x. Files were moved to a new server during the upgrade to 6.0x. Then, the system was upgraded to 7.0.0 (2). This is when it is brought up that the files in the documents folder are not accessible only in the report. Going into the patient’s chart, the file can be viewed and downloaded. But the reports show a broken link.

Has anyone else experienced this issue?

Read up on these 2 files:
sites/default/documents/logs_and_misc/methods/
sixa
sixb

I suspect the issue is during the upgrade process. We lost those keys somewhere. The new files uploaded after the last upgrade all work fine. The files before the upgrade cannot be accessed. Is there a way to gain access to the previously encrypted files?

Yes, your upgrade process needs to include retaining sixa and sixb.

But what happens if you merely delete them and allow them to be auto recreated? I know I’ve done that in the past and it worked, but perhaps things have changed since; I wouldn’t want to recommend it, would rather someone chimed in who knew better, but I do recommend giving it a try on a test copy of your current system.

As @PeteBoyd stated the sixa and sixb keys are literally the keys to decrypting the files.

The keys are stored in 2 files but they are also stored in the database. If you have an old backup of the database look at table “keys”.

Without those keys i doubt you’ll be able to decrypt the files.

checkout brady’s nice explanation of the keys mechanism

1 Like