I am working with some C# developer in a team. They encrypted a cookie via c# and I am supposed to decrypt it and use it on another subdomain via php. what they send me as c# code to decrypt it is:
var cookie = Request.Cookies["mycookie"];
if (cookie != null)
{
var key = "Hn9*e$";
var bytes = Convert.FromBase64String(cookie.Value);
var output = MachineKey.Unprotect(bytes, key);
var result = Encoding.UTF8.GetString(output);
}
I wonder how can I do this in PHP. I know how to decode base64 but for the rest of that I have no idea and i could not find a clue.