Skip to content
Snippets Groups Projects
Commit 5a85b925 authored by Christoph Zysik's avatar Christoph Zysik
Browse files

decludder datenbank.inc.php

parent 0d33c7a0
No related merge requests found
<?php <?php
require_once( __DIR__ .'/db_config.php'); require_once( __DIR__ .'/db_config.php' );
//Passwort zusatz
$pw_zusatz = 'fg65en';
// Verschlüsselungspasswort
$ver_schluessel = 'libh5476H6G4v0TB';
//Datenbankverbindung herstellen //Datenbankverbindung herstellen
$sql_open = @mysqli_connect( DB_HOST, DB_USER, DB_PASS, DB_BASE ) or die('Verbindung zum Mysql Server fehlgeschlagen! <br>Tipp: <a href="http://www.vms-tutorial.de/wiki//Lib/Functions">http://www.vms-tutorial.de/wiki//Lib/Functions</a>'); $sql_open = @mysqli_connect( DB_HOST, DB_USER, DB_PASS, DB_BASE ) or die('Verbindung zum Mysql Server fehlgeschlagen! <br>Tipp: <a href="http://www.vms-tutorial.de/wiki//Lib/Functions">http://www.vms-tutorial.de/wiki//Lib/Functions</a>');
...@@ -85,8 +80,7 @@ function db_fetch($result) ...@@ -85,8 +80,7 @@ function db_fetch($result)
} }
function pw_erstellen($pw){ function pw_erstellen($pw){
global $pw_zusatz; $pw_er = hash("sha256",$pw. PW_ZUSATZ );
$pw_er = hash("sha256",$pw.$pw_zusatz);
return $pw_er; return $pw_er;
} }
......
...@@ -279,18 +279,16 @@ function geoIP($ip){ ...@@ -279,18 +279,16 @@ function geoIP($ip){
} }
function versch($text){ function versch($text){
global $ver_schluessel;
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$crypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $ver_schluessel, $text, MCRYPT_MODE_ECB, $iv); $crypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, VER_SCHLUESSEL, $text, MCRYPT_MODE_ECB, $iv);
return $crypted; return $crypted;
} }
function entsch($text){ function entsch($text){
global $ver_schluessel;
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$encrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $ver_schluessel, $text, MCRYPT_MODE_ECB, $iv); $encrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, VER_SCHLUESSEL, $text, MCRYPT_MODE_ECB, $iv);
return $encrypted; return $encrypted;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment