How to restore an encrypted SD card backup after factory reset?
The encryption key should be located in /data/misc/vold. If you backed up that directory, you should see a .key file with a long name inside. Open that file with a hex editor, and copy the 16-bit key. You can decrypt your storage using this command in a Linux distribution:

dmsetup create crypt1 --table "0 `blockdev --getsize &lt;your device ID, ex:/dev/sdb&gt;` crypt \aes-cbc-essiv:&lt;key you copied&gt; 0 &lt;your device ID again&gt; 0"


Source of the command