From 70d8c0e46771e2693469ec97135766729a6ab771 Mon Sep 17 00:00:00 2001 From: nolanwhy <69528856+nolanwhy@users.noreply.github.com> Date: Tue, 28 Mar 2023 08:58:11 +0200 Subject: [PATCH] signer scripts without privatekey scriptsign("local a = \"hi\""); and arraysign(["username"=>"hi"]); --- core/config.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/core/config.php b/core/config.php index 0acd577..f2a9de6 100644 --- a/core/config.php +++ b/core/config.php @@ -59,6 +59,40 @@ $site = [ "url" => "https://".$_SERVER["HTTP_HOST"] ]; +/** + * Name: Script Signer + * Description: This function returns the "rbxsig" signature and the script. + * Parameters: [ + * "script" => "The script to sign", + * "privatekey" => "Private key used to sign" + * ] +*/ +function scriptsign($script) { + global $gameSettings; + $privatekey = $gameSettings["privatekey"]; + $signature; + $script = "\n".$script; + openssl_sign($script, $signature, $privatekey, OPENSSL_ALGO_SHA1); + return "--rbxsig" . sprintf("%%%s%%%s", base64_encode($signature), $script); +} + +/** + * Name: Array Signer + * Description: This function returns the "rbxsig" signature and the array. + * Parameters: [ + * "array" => "The array to sign", + * "privatekey" => "Private key used to sign" + * ] +*/ +function arraysign($array) { + global $gameSettings; + $privatekey = $gameSettings["privatekey"]; + $signature; + $jsonarray = "\n".json_encode($array); + openssl_sign("\r\n" . $jsonarray, $signature, $privatekey, OPENSSL_ALGO_SHA1); + return "--rbxsig" . sprintf("%%%s%%%s", base64_encode($signature), $jsonarray); +} + //pagenam $pagename = ucwords(str_replace("_", " ", str_replace(".php", "", str_replace("/", " ", $_SERVER['DOCUMENT_URI'] ?? $_SERVER['PHP_SELF']))));