简体   繁体   English

PHP中的解密函数返回值1(我在做什么错?)

[英]Decryption function in PHP returning a value of 1 (What am I doing wrong?)

This is the method 这是方法

public function _PRZ_decrypt_data($_salt, $_input)
{   
    return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $_salt, $_input, MCRYPT_MODE_ECB, $this->_PRZ_get_iv()));
}

I am calling it as one of my parameters as follows 我称它为我的参数之一,如下所示

$this->_PRZ_decrypt_data($salt, base64_decode($code))

It seems to be returning a 1 when a properly endoded value is decoded via the function. 通过函数解码正确赋值的值时,似乎返回1。

Break the function calls into a single action per line, and output the inputs, and result of each step. 将函数调用分成每行一个动作,然后输出输入和每个步骤的结果。 Make sure that you are passing appropriate values in, and get sensible outputs. 确保您传入适当的值,并获得合理的输出。 As the saying goes - GIGO . 俗话说-GIGO That will tell you where the bad data is coming from. 这样可以告诉您不良数据的来源。 Guessing does not. 猜测没有。

Then, look at the manual page on mcrypt_decrypt() to see examples of use. 然后,查看mcrypt_decrypt()手册页以查看使用示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM