Merge pull request #2208 from maxgalbu/issue2157

criteria: fix issue #2157 and added tests
Move security global initialization
remove pre-processed constants
Merge pull request #2542 from WooDzu/security-hash-fix

[1.3.3] Fix Security::hash()