0

在 CI 的一个 Web 应用程序中,他们曾经将 COOKIE 数据保存为加密形式,然后通过解密来检索。由于某些安全原因(不知道为什么),它工作正常,因为“GoDaddy”阻止了“base64_encode”。这是我得到的错误

A PHP Error was encountered
Severity: Warning
Message: base64_decode() has been disabled for security reasons
Filename: models/extras.php
Line Number: 196

我的加密和解密代码如下。有没有其他方法可以在没有“base64_encode”的情况下做同样的事情?

function encodeString($str){
  for($i=0; $i<5;$i++)
  {
    $str=strrev(base64_encode($str)); //apply base64 first and then reverse the string
  }
  return $str;
}

function decodeString($str){
  for($i=0; $i<5;$i++)
  {
    $str=base64_decode(strrev($str)); //apply base64 first and then reverse the string}
   }
   return $str;
}

提前致谢

4

2 回答 2

1

为了消除此错误消息,您需要执行以下操作之一:

  • 从 php.ini* 文件的 disable_functions 中删除 base64_decode 字符串
  • 如果您无权访问 php.ini* 文件,请让您的托管服务提供商删除上面的字符串
  • 更改允许运行 base64_decode 函数的托管服务提供商。
于 2013-04-15T06:08:10.010 回答
0
$data =array(           

 'password'    => md5($this->input->post('password')),

);
于 2014-01-20T14:16:41.257 回答