Open tylerhcarter opened 8 years ago
How do I get the password back to connect to database ?
I'm confused. The whole reason we're using an encryption method instead of a hashing method is so you can just do something like:
$details = get_database_info( $account );
$resource = mysql_connect( ..... some_decrypt_function( WZ_SECURITY_KEY, $details['password'] ), .... );
Got it :)
Currently all passwords, except user logins, are stored plaintext in the
.sqlite
database. This creates a security issue if someone got access to that file through the web server. The same issue is true if it is stored in a MySQL database in the future. Anyone with access can see the passwords.Ideally, all passwords should be encrypted using a randomly generated key that is unique for each site and stored separately from the database. This will help us on a number of levels:
$key = md5hash( $website_domain );
would be guessable by anyone who knows the source code.My suggestion for this is to have the setup routine automatically create a configuration file when it doesn't already exist. We could store it as a file
Config/wz-config.php
and automatically set seeds. Here's a quick example to prove the concept.This is quite similar to how WordPress does it, although they provide a sample config file and copy it over. Drupal has a similar mechanism, although its up to you to manually copy it over yourself.
From here, it's a hop-skip-and-a-jump over to defining any other site specific configuration options in a non-core file. Once that
wz-config.php
file is created, you could just have users drop in constants in order to tweak the behavior of WebZash.