Configurable iv source for Security.php

Caution! Code should work, but is not tested. Fixes #5754