From 070ca57c96a38d5c14202d100e8f7c77c17affa7 Mon Sep 17 00:00:00 2001 From: vincent Date: Wed, 16 Apr 2025 09:56:15 +0200 Subject: [PATCH] added Key Grabber --- keyGrab.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 keyGrab.php diff --git a/keyGrab.php b/keyGrab.php new file mode 100644 index 0000000..d071fd9 --- /dev/null +++ b/keyGrab.php @@ -0,0 +1,54 @@ +connect_error) { + die("Connection failed: " . $conn->connect_error); + } + + $sql = "SELECT publicKey FROM smz_messages_users WHERE uid='$uid'"; + $result = $conn->query($sql); + if ($result->num_rows > 0) { + while($row = $result->fetch_assoc()) { + return $row["publicKey"]; + } + } else { + // ungültige Session + return false; + } + $conn->close(); +} +function grabPrivateKey(){ + global $dbservername; + global $dbusername; + global $dbpassword; + global $dbname; + global $uid; +// global $password_hash; + $conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname); + if ($conn->connect_error) { + die("Connection failed: " . $conn->connect_error); + } + + $sql = "SELECT privateKey FROM smz_messages_users WHERE uid='$uid'"; + $result = $conn->query($sql); + if ($result->num_rows > 0) { + while($row = $result->fetch_assoc()) { + return $row["privateKey"]; + } + } else { + // ungültige Session + return false; + } + $conn->close(); +} + + + ?>