【发布时间】:2017-06-17 22:12:36
【问题描述】:
我需要使用不同的应用程序密钥在 2 个 laravel 之间传递加密信息。但是在第二个 laravel 上,我无法读取数据。
我试过的(不工作,正常):
Crypt::encrypt($request['infos'])
另一个测试:
$crypt=new \Illuminate\Encryption\Encrypter('base64:mnBCwiIMaW5QqwEixWp79bunoYt0MGHTIhdOpkDd9Oc=', 'AES-256-CBC')
$crypt=$crypt->encrypt($request['infos'])
和
$crypt=new \Illuminate\Encryption\Encrypter('mnBCwiIMaW5QqwEixWp79bunoYt0MGHTIhdOpkDd9Oc=', 'AES-256-CBC')
$crypt=$crypt->encrypt($request['infos'])
错误:The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths。
我试图覆盖Illuminate\Encryption\Encrypter 的__construct 方法上的$this->key 属性
最后一个,我试图覆盖registerIlluminate\Encryption\EncryptionServiceProvider的$key方法
在我的第二个 laravel 中,我遇到了同样的错误:The MAC is invalid
【问题讨论】:
-
我尝试了使用和不使用“base64:”但检查我的答案它解释了为什么它不起作用
标签: php laravel encryption laravel-5.2