Forgot about these lmao
This commit is contained in:
1
config/.htaccess
Normal file
1
config/.htaccess
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Require all denied
|
||||||
1
incl/.htaccess
Normal file
1
incl/.htaccess
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Require all denied
|
||||||
@@ -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'));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user