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

Fixes #4114.

Needs review.
Nope, it was string of length 32 and is now the same string of length 32.