Created
April 28, 2024 03:10
-
-
Save 000pp/bf5573d3956ee97f4ac9ce62b9200831 to your computer and use it in GitHub Desktop.
Decrypt GLPI encrypted values with glpicrypt.key
This file contains hidden or 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 | |
$encoded_value = base64_decode('Enconded_Base64_String'); | |
$nonce = substr($encoded_value, 0, SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES); | |
$ciphertext = substr($encoded_value, SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES); | |
$private_key = file_get_contents('glpicrypt.key'); | |
$decrypted = sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($ciphertext, $nonce, $nonce, $private_key); | |
echo "Result: " . $decrypted; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment