Encrypt/Decrypt AES256 - (Security::encrypt((string)$value, $key);

I write Cookies as mentioned above - encrypted with Security::encrypt.
$key is what I get with Security::getSalt();
Does anybody know how to decrypt in plain PHP?
I have a PHP-Script that should read and write cookies from my Cake application.
There are different versions of AES256.
I am using Cake 4.2.3.

Thanks for helping me.

What function are you using to encrypt them?

Have you seen then encrypted cookie middleware?