Fix #87: security helper converted into component and improved

Fix #87: security helper improvement

Migrated from #4052
It's already mentioned in docs that `This option is recommended, but it requires PHP version >= 5.5.0`