无法解密/解code键 [英] Unable to decrypt/decode key

查看:219
本文介绍了无法解密/解code键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看来,我的消费密钥对Twitter的API 1.1没有被解密在我的codeIgniter控制器在我的Amazon EC2实例<一href="http://stackoverflow.com/questions/15026242/$c$cigniter-cannot-de$c$c-the-encrypted-password">(slightly类似这样的问题)因为

It appears that my consumer secret key for Twitter API 1.1 is not being decrypted in my CodeIgniter controller on my Amazon EC2 instance (slightly similar to this question) because

  • 在我得到了一个无法排除故障时为您验证错误
  • 我的的print_r($设置)声明(见下文)显示unreadeable字符在我解密它此行的事实,浏览器inspite消费者的秘密'CONSUMER_SECRET'=&GT; $这个 - &GT; encrypt-&GT;德code($这个 - &GT; config-&GT;项目(CONSUMER_SECRET')
  • I got an unable to authenticate you error while troubleshooting
  • and my print_r($settings) statement (see below) displays unreadeable characters for the consumer secret in the browser inspite of the fact that I decrypted it with this line 'consumer_secret' => $this->encrypt->decode($this->config->item('consumer_secret').

my_controller.php

$settings = array(
            'oauth_access_token' => $this->config->item('oauth_access_token'),
            'oauth_access_token_secret' => $this->config->item('oauth_access_token_secret'),
            'consumer_key' => $this->config->item('consumer_key'),
            'consumer_secret' => $this->encrypt->decode($this->config->item('consumer_secret'))
        );  
        print_r($settings);

注:我保存在加密消费密钥在codeIgniter的配置目录,并设置在config.php我的加密密钥。有趣的是,它工作正常,在WAMP但不是在Amazon EC2上。

Note: I saved the encrypted consumer secret key in CodeIgniter's configuration directory and also set my encryption key in config.php. Interestingly, it works fine in WAMP but not in Amazon EC2.

我该如何解决这个问题呢?如果我只是救了未加密的用户密钥在配置文件?

How do I resolve this problem? Should I just save the unencrypted consumer secret key in the configuration file?

推荐答案

codeigniter使用一些标准的加密库和回落,如果他们不具备的。我不认为的mcrypt 可在默认亚马逊的Linux AMI。您可以

Codeigniter uses some standard encryption libraries and falls back if they aren't available. I don't think mcrypt is available on the default Amazon Linux AMI. You can

一)使用备用;刚刚重新加密CONSUMER_SECRET在EC2上,并把它在config

a) use the fallback; just re-encrypt the consumer_secret on ec2 and put it in the config

b)安装的mcrypt

b) install mcrypt

$ sudo yum install php-mcrypt
$ sudo service httpd restart

这篇关于无法解密/解code键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆