用Java解密RIJNDAEL-128

时间:2015-06-24 13:40:16

标签: java php laravel laravel-5 rijndael

我在Laravel中使用Crypt功能加密了文本。我正在使用密码 - MCRYPT_RIJNDAEL_128和CBC。我怎样才能用Java解密?这是Laravel / PHP中的解密代码

$payload = json_encode(base64_decode($payload), true);
$value = base64_decode($payload['value']);
$iv = base64_decode($payload['iv']);
return unserialize($this->stripPadding($this->mcryptDecrypt($value, $iv)));

protected function mcryptDecrypt($value, $iv)
    {
        try
        {
            return mcrypt_decrypt($this->cipher, $this->key, $value, $this->mode, $iv);
        }
        catch (Exception $e)
        {
            throw new DecryptException($e->getMessage());
        }
    }

0 个答案:

没有答案