Ok. thank you for taking time to post your answers!

I will combine a few methods to make possibly the most secured solution of this unsecured thing.
I think that most people don't do something like this and they don't care that they have directory with 777 permissions. But I'm always paranoid about the security but I guess it's good to be a bit paranoid after all.