If you try the original files_encryption and put a breakpoint on the described above so will see that the "enckey" in the session has 4 times \0 at the end. I think this was an mistake which was not discovered.