Created
August 12, 2023 11:04
-
-
Save Antosser/55a934564c2455ba70ad40f201953571 to your computer and use it in GitHub Desktop.
GJP decryption
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$gjp = "your_encoded_gjp_here"; | |
$gjpdecode = str_replace("_", "/", $gjp); | |
$gjpdecode = str_replace("-", "+", $gjpdecode); | |
$gjpdecode = base64_decode($gjpdecode); | |
class XORCipher { | |
public static function cipher($plaintext, $key) { | |
$key = self::text2ascii($key); | |
$plaintext = self::text2ascii($plaintext); | |
$keysize = count($key); | |
$input_size = count($plaintext); | |
$cipher = ""; | |
for ($i = 0; $i < $input_size; $i++) | |
$cipher .= chr($plaintext[$i] ^ $key[$i % $keysize]); | |
return $cipher; | |
} | |
private static function text2ascii($text) { | |
return array_map('ord', str_split($text)); | |
} | |
} | |
$decrypted_text = XORCipher::cipher($gjpdecode, 37526); | |
echo "Decrypted Text: " . $decrypted_text . "\n"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment