TES: enkripsi lua base64 & key

This commit is contained in:
syn 2025-01-19 03:42:02 +07:00
parent 5a68704a4b
commit 00c6f3ac4d
4 changed files with 42 additions and 0 deletions

1
endec/encode.md Normal file
View File

@ -0,0 +1 @@
# Tes

23
endec/encode.php Normal file
View File

@ -0,0 +1,23 @@
<?php
function encrypt_lua($lua_code, $key) {
$encode = base64_encode($lua_code);
$key_length = strlen($key);
$result = '';
for ($i = 0; $i < strlen($encode); $i ++) {
$result .= chr(ord($encode[$i]) ^ ord($key[$i % $key_length]));
}
return base64_encode($result);
}
// lua code disini
$lua_code = 'print("Hello, Ini adalah code lua yang akan di enkripsi")';
// key enkripsi
$key = "cdaaptnia";
// luna maya
$encrypted_code = encrypt_lua($lua_code, $key);
//simpan luna maya
file_put_contents('enlua.txt', $encrypted_code);
echo "Luna maya terenkripsi dengan key base64:\n" . $encrypted_code . "\n";
?>

1
endec/enlua.txt Normal file
View File

@ -0,0 +1 @@
ACwrERIaPwYoCAwNAzcMGCUiIS4DDBsTNz4zCwYmJx89KScXOSM0BhI8OAEoKwgJAx0XCTA2FwwDCDIfDzojDwYMFQkVNisbAjcoEQ==

17
endec/getraw.lua Normal file
View File

@ -0,0 +1,17 @@
--[[ Untuk Contoh tidak untuk produksi ]]
local http = game:HttpGet("http://example.com/raw/enlua.txt") --[[ berhububung we di lokal ya tiggal pake lokal tapi lebih bagus nya external ]]
local key = "cdaaptnia"
function decrypt_code(encrypted, key)
local decoded = game.HttpService:base64Decode(encrypted)
local result = ""
for i = 1, #decode do
local char = string.byte(decode, i)
local key_char = string.byte(key, (i - 1) % #key + 1)
result = result .. string.char(bit32.bxor(char, key_char))
end
return game.HttpService:Base64Decode(result)
end
local decrypted_code = decrypt_code(http, key)
loadstring(decrypt_code)()