Owncloud 8 : manually decrypt files

Owncloud has the ability to encrypt files. You can restore your files with a complete backup/restore of your Owncloud folder, but what if you want to restore just one file from a previous backup ? Here is the code for a one-shot file decryption.