Fix #87: security helper converted into component and improved

Fix #87: security helper improvement

Migrated from #4052
Yes but insert "and re-encrypt/re-hash using the 'security' component" at end.