Welcome Guest, Not a member yet? Register   Sign In
How to store password
#2

I faced this problem before and initially my solution was wrong for which I was badly punished. :-)

Now I have a library that keeps settings within the database with ability to encrypt certain setting at will. https://github.com/ivantcholakov/starter...ttings.php

See the method set:
public function set($key, $value = null, $encrypt = false)

Let us say we have the setting 'smtp_password'. If it is stored within the table in plain text (we don't want this), the key within the table 'settings' would be 'smtp_password' too. Encrypted 'smtp_password' (we want this) would be stored under the key 'smtp_password__encrypted'. This is how I distinguish non-encrypted and encrypted settings. Another way is a database field (as a binary flag) 'encrypted' to be added, but I did not want to change the structure of the table anymore.

While an encrypted setting is retrieved, it gets decrypted automatically, you don't have to worry about that.

Perhaps you have something for storing settings within a database table, upgrade it in a similar way, I think it would be fine.
Reply


Messages In This Thread
How to store password - by ignitedcms - 07-26-2015, 02:39 PM
RE: How to store password - by ivantcholakov - 07-26-2015, 03:48 PM
RE: How to store password - by ignitedcms - 07-26-2015, 04:17 PM
RE: How to store password - by ivantcholakov - 07-26-2015, 05:10 PM
RE: How to store password - by mwhitney - 07-27-2015, 08:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB