Categories
PHP

PHP解密AES

By @sskaje
Link: https://sskaje.me/2015/02/php-aes-encrypt-decrypt/

分析某客户端协议,发现如下代码:

这个和之前分析航旅纵横客户端时的代码类似,都是128位ECB。
当时只是用openssl看了看请求:

于是参考mcrypt的文档,写了简单的代码实现上边Java代码里的AES 128 ECB加密解密

PHP解密AES by @sskaje: https://sskaje.me/2015/02/php-aes-encrypt-decrypt/
Categories
杂七杂八

Hijack HTTPS over TLS 1.2 without Charles Proxy

By @sskaje
Link: https://sskaje.me/2014/09/charles-proxy-tls-1-2/

TLS 1.2

Charles Proxy 3.9 uses the bouncycastle 1.4 for SSL/TLS, but TLS 1.2 is not yet supported in bcprov’s latest release(1.51), that’s why I got a

on some sites.

I tried to upgrade bcprov.jar, some incompatible exceptions were thrown.

To check if a https site uses TLSv1.2:

Hijack HTTPS over TLS 1.2 without Charles Proxy by @sskaje: https://sskaje.me/2014/09/charles-proxy-tls-1-2/

Incoming search terms:

Categories
Hadoop相关 Hive Impala PHP 学习研究

PHP ODBC Connect Cloudera Impala and Hive

By @sskaje
Link: https://sskaje.me/2014/07/php-odbc-connect-cloudera-impala-hive/

Environment

CentOS 5.5
PHP 5.3.10
(This article also works for PHP 5.3.3 on CentOS 6).

Dependencies

UnixODBC

UnixODBC can be installed from yum repo

I built a unixODBC 2.3.2 from source, installed to /usr/local/unixODBC

ODBC Connectors

Cloudera offers ODBC libs for both Hive and Impala:
http://www.cloudera.com/content/support/en/downloads/connectors/impala/impala-odbc-v2-5-15.html
http://www.cloudera.com/content/support/en/downloads/connectors/hive/hive-odbc-v2-5-9.html

Follow the install guide on urls above, only wget and yum –nogpgcheck localinstall xxx.rpm required.

PHP ODBC Connect Cloudera Impala and Hive by @sskaje: https://sskaje.me/2014/07/php-odbc-connect-cloudera-impala-hive/

Incoming search terms:

Categories
PHP 学习研究

Build Old PHP-ODBC from Source

By @sskaje
Link: https://sskaje.me/2014/07/build-php-odbc-source/

CentOS 5.5 + PHP 5.3.10, I’ve built the latest unixODBC 2.3.2 from source to /usr/local/unixODBC.

I need to add php-odbc to my php’s extension list, as what I did, phpize && configure && make, but error occurred:

I tried to add ‘–with-adabas=no‘, but failed.

The solution is, DELETE all configs like

and leave the

block in config.m4.

Then phpize, configure, make.

For pdo_odbc, configure may like

Build Old PHP-ODBC from Source by @sskaje: https://sskaje.me/2014/07/build-php-odbc-source/

Incoming search terms:

Categories
微信 项目、研究

微信公众平台API开发框架

By @sskaje
Link: https://sskaje.me/2013/07/weixin/

https://github.com/sskaje/weixin

继承 spWxRequest 创建请求响应类,然后用 spWxMessage::RegisterHandler(spWxMessage::REQUEST_TEXT, ‘spWxRequestDefault’); 的方法来注册请求处理。

增加了文档中未提及的语音、视频消息类型。

菜单之类的操作没权限就没写完。

微信公众平台API开发框架 by @sskaje: https://sskaje.me/2013/07/weixin/