public static function getEncryptionKey()
	{
		$key = self::getConfig('encryptionKey', NULL, 'settings_', true);
		if ($key == NULL || $key == "")
		{
				try {
					$key = Crypto::CreateNewRandomKey();
				} catch (CryptoTestFailedException $ex) {
					throw new CException('Encryption key generation failed');
				} catch (CannotPerformOperationException $ex) {
					throw new CException('Encryption key generation failed');
				}

				$config = new Configuration;
				$config->attributes = array(
					'key' => 'encryptionkey',
					'value' => bin2hex($key)
				);

				if (!$config->save())
					throw new CException('Encryption key generation failed');
		}

		return hex2bin(self::getConfig('encryptionKey', NULL, 'settings_', true));
	}