Home  >  Article  >  Backend Development  >  laravel framework session id decryption algorithm

laravel framework session id decryption algorithm

巴扎黑
巴扎黑Original
2016-11-08 11:25:561777browse

$encrypter = new Illuminate\Encryption\Encrypter('qianzhudecangshu');
        $session_filename = $encrypter->decrypt($_COOKIE['cangshu']);
        var_dump($session_filename);exit;

The above one is a third-party library https://github.com/illuminate/encryption. The solution is actually just a package that relies on laravel’s built-in implementation, which is useless

The following one is the built-in library of laravel 4.1

laravel framework session id decryption algorithm

$b = Crypt::decrypt($_COOKIE['cangshu']);
dump($b);
$a = Crypt::encrypt('96c65a2077a21ad8e960ba1078641f90e2d93aa1');
dump($a);
$c = Crypt::decrypt($a);
dump($c);


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP Get current URLNext article:PHP Get current URL