I am building a Joomla! 3.x component that connects to an API. The API settings are currently established in the component configuration. The configuration details are stored in plain text in the database, which is not desirable. Is it possible to instruct Joomla! to encrypt configuration data? If so, how is this done.

  • 1
    Is a key required to connect to the API currently? If not, maybe look into this, else maybe utilise BCrypt for login details that will be required to use it
    – Lodder
    Aug 25 '15 at 20:22
  • 1
    Hi Lodder, yes a key is required. The API uses a combination of an ID and a Key. How would you use BCrypt with Joomla!'s configuration settings? Would you have to handle the settings outside of Joomla!'s configuration, such as on a custom component settings page? Aug 25 '15 at 20:45
  • Akeeba Backup seems to do this in its config settings - I've had this same requirement pop up, just haven't had a chance to research it yet. Mar 30 '16 at 14:46

You can do this with a plugin I suppose, there are two events you would need to target.

On save the event name is "onExtensionBeforeSave" and on loading the saved details "onContentPrepareForm" to insure data integrity.

You can in the plugin target your component and those events. This is a good starting place on how to build a plugin.

Then you can then use Lodder's suggestion of BCrypt for you encryption or you can take a look at JCrypt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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