Stable6 fix encryption

Should fix rename of encryption keys if sub-subfolder doesn't exists.

see #6411 

Maybe it also fix #8936