Forgot about these lmao

This commit is contained in:
2025-12-31 16:36:44 -07:00
parent cf6c0eff73
commit 87e595b420
3 changed files with 8 additions and 2 deletions

1
config/.htaccess Normal file
View File

@@ -0,0 +1 @@
Require all denied

1
incl/.htaccess Normal file
View File

@@ -0,0 +1 @@
Require all denied

View File

@@ -27,17 +27,21 @@ function getClientVersion() {
function encrypt($plainText) { function encrypt($plainText) {
include __DIR__.'/../config/encryption.php'; include __DIR__.'/../config/encryption.php';
$key = $SERVER_SEND_TRANSFER_KEY_SPECIFIC[getClientVersion()];
if ($key == null) return;
$iv = random_bytes(16); $iv = random_bytes(16);
$cipher = openssl_encrypt($plainText, 'aes-256-cbc', $SERVER_SEND_TRANSFER_KEY_SPECIFIC[getClientVersion()] ?? $SERVER_SEND_TRANSFER_KEY, OPENSSL_RAW_DATA, $iv); $cipher = openssl_encrypt($plainText, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv);
return base64_encode($iv . $cipher); return base64_encode($iv . $cipher);
} }
function decrypt($dataB64) { function decrypt($dataB64) {
include __DIR__.'/../config/encryption.php'; include __DIR__.'/../config/encryption.php';
$key = $SERVER_RECEIVE_TRANSFER_KEY_SPECIFIC[getClientVersion()];
if ($key == null) return;
$data = base64_decode($dataB64); $data = base64_decode($dataB64);
$iv = substr($data, 0, 16); $iv = substr($data, 0, 16);
$cipher = substr($data, 16); $cipher = substr($data, 16);
$decrypted = openssl_decrypt($cipher, 'aes-256-cbc', $SERVER_RECEIVE_TRANSFER_KEY_SPECIFIC[getClientVersion()] ?? $SERVER_RECEIVE_TRANSFER_KEY, OPENSSL_RAW_DATA, $iv); $decrypted = openssl_decrypt($cipher, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv);
if ($decrypted === false) { if ($decrypted === false) {
exit(encrypt('-997')); exit(encrypt('-997'));
} }