I am working on Payment Gateway. for data encryption and decryption I want to write encryption key for particular extension at the time of installation.

My question is which is the better way to manage key specific to particular extension ?

can I write key in module config.xml file ? Or Can i write one new file in module to generate key ?

Please help

1 Answer 1


During installation you can generate key and store it in database in core_config_data.

Mage::getConfig()->saveConfig('path/to/config_value', $value, $scope, $scopeId);

Also you can make this config field editable in System->Configuration. So customer can change encryption key.

In addition in configuration you can add regenerate button, to allow admin to regenerate encryption key.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.