Fix #87: security helper converted into component and improved

Fix #87: security helper improvement

Migrated from #4052
It is just a fallback from 'mcrypt' absense. While encrypt/decrypt methods can not function without 'mcrypt' module this method becomes strong automatically in case of thier usage.
Fallback kept mainly for BC.