Jump to content

Question on encryption


Go to solution Solved by Stuart Silvester,

Recommended Posts


I have a plugin that uses the IPS\Text\Encrypt class descrypt and encrypt methods to store client login data. After moving to a new server the data can no longer be decrypted. Is is possible to transfer the encryption key to the new server to allow this to continue working?


Link to comment
Share on other sites

If you moved to another host you probably changed your sql database details. So, look:

	 * Get Key
	 * @return	void
	public static function key()
		return \IPS\TEXT_ENCRYPTION_KEY ?: md5( \IPS\Settings::i()->sql_pass . \IPS\Settings::i()->sql_database );

It won't work due to this.

Link to comment
Share on other sites

  • Solution
Just now, Paul E. said:

Wait... so encrypted data ceases to be accessible if you do something standard like rotate service account passwords? 😵

Why isn't there a constant that's used as an encryption key just for this purpose so that the password can be changed without affecting anything else?

There is a constant ( TEXT_ENCRYPTION_KEY ) that you can set if you change your credentials. If you already have encrypted text stored, you would need to calculate the same MD5 and then save it to constants.php

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...