Skip to content

Instantly share code, notes, and snippets.

@spinsch
Created January 30, 2019 09:04
Show Gist options
  • Save spinsch/c52450c5b6339b195d0c363c45023f2e to your computer and use it in GitHub Desktop.
Save spinsch/c52450c5b6339b195d0c363c45023f2e to your computer and use it in GitHub Desktop.
test script to find the correct method
<?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