First open the machine.config file and add a machine input entry. Set the decryption key and the verification key according to the randomly generated machine keys generator for aspnet 2.0.
Be sure to use the default settings, i.e. AES and SHA1. Now that you have the AES decryption key, save it somewhere because you will need it on the php side. In your dot network app go to web.config and get the auth cookie name, usually something like .ASPXAUTH
Now go to the PHP side. Download and configure the AES encryption library such as http://phpseclib.sourceforge.net/documentation/
Then in PHP you can do something like this (this uses phpsec lib):
set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib'); include('Crypt/AES.php'); $authCookie = $_COOKIE['_ASPXAUTH']; echo $authCookie; $aes = new Crypt_AES(); $aes->setKey('BCDCBE123654F3E365C24E0498346EB95226A307857B9BDE8EBA6198ACF7F03C'); echo $aes->decrypt($authCookie);
Now what eventually comes out will be to first have PM + SHA1 hash + byte representation of the auth ticket. You must convert serialized bytes to a string to make it readable. Can anyone add on this last step?
jaime ignacio
source share