Added Security::generateRandomHexKey(), used it for various tokens and default key generation

Fixes #4114.

Needs review.
@qiangxue any idea how to implement it in secure way? It was implemented in our Security helper but according to experts wasn't good enough.