Created
January 30, 2019 09:04
-
-
Save spinsch/c52450c5b6339b195d0c363c45023f2e to your computer and use it in GitHub Desktop.
test script to find the correct method
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 | |
$data = "123456"; | |
$key = "17839778773fadde0066e4578710928988398877bb123789"; | |
$options = 0; | |
$key = pack("H*", $key); | |
foreach (openssl_get_cipher_methods() as $method) | |
{ | |
$enc = @openssl_encrypt($data, $method, $key, $options); | |
$dec = @openssl_decrypt($enc, $method, $key, $options); | |
if ($enc == 'Ja79hWTRfBE=' && $dec == $data) { | |
echo $method; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment