added debugging mode to error handler. added config values for encryption key and debug mode, configurable from file.