fbbin.com
域名年龄: 13年6个月21天HTTP/1.1 200 OK 访问时间:2016年11月13日 06:57:25 服务器:Apache/2 语言环境:PHP/5.3.29 X-Pingback: http://blog.fbbin.com/xmlrpc.php 设置Cookie:wptouch-pro-cache-state=desktop; expires=Sat, 12-Nov-2016 23:57:25 GMT; path=/ 动作:Accept-Encoding,User-Agent Content-Encoding: gzip 文件大小:15994 Keep-Alive: timeout=1, max=100 连接:Keep-Alive 类型:text/html; charset=UTF-8 网站编码:UTF-8
一路走来……
现在睡觉,只会做梦;现在努力,才能让梦想实现!
主页CachejQueryLinuxMySQLNginxNoSQLPHPPHP框架技术其他服务器相关php hex加密解密工具方法
没有评论
2014 年 05 月 14 日 at 上午 9:35分类:PHP
//Hex(Hex(Md5((原文+密钥).getBytes(“utf-8”))).getBytes(“utf-8”))function String2Hex($string){$hex='';for ($i=0; $i < strlen($string); $i++){$hex .= dechex(ord($string[$i]));}return $hex;}function Hex2String($hex){$string='';for ($i=0; $i < strlen($hex)-1; $i+=2){$string .= chr(hexdec($hex[$i].$hex[$i+1]));}return $string;}// example:$hex = String2Hex("test sentence...");$data = array('appId' => 'SHAN-GUO-CHI-BI', 'data' =>'{"appId":"SHAN-GUO-CHI-BI","cardNo":"6006012000000001"}', 'sig'=>'4331443139334331313645464642444544364334343742374236364335454243',);$key = '111111111111111111111111';$data['sig'] = String2Hex(strtoupper(md5($data['data'] . $key)));PHP与JAVA或者C#的3DES加密代码
没有评论
2014 年 05 月 12 日 at 下午 1:12分类:PHP
<?php/*** 3DES加密处理类** @author fbbin <fbbin@gmail.com>* @version 1.0 beta* @created 2013/04/26* @logs*/class SecretUtilTools { //加密算法 function encryptForDES($input,$key) { $size = mcrypt_get_block_size('des','ecb'); $input = $this->pkcs5_pad($input, $size); $td = mcrypt_module_open(MCRYPT_3DES, '', 'ecb', ''); $iv = @mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); @mcrypt_generic_init($td, $key, $iv); $data = mcrypt_generic($td, $input); mcrypt_generic_deinit($td); mcrypt_module_close($td); $data = base64_encode($data); return $data; } //解密算法 function decryptForDES($encrypted,$key) { $encrypted = base64_decode($encrypted); $td = mcrypt_module_open(MCRYPT_3DES,'','ecb',''); //使用MCRYPT_DES算法,cbc模式 $iv = @mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); $ks = mcrypt_enc_get_key_size($td); @mcrypt_generic_init($td, $key, $iv); //初始处理 $decrypted = mdecrypt_generic($td, $encrypted); //解密 mcrypt_generic_deinit($td); //结束 mcrypt_module_close($td); $y=$this->pkcs5_unpad($decrypted); return $y; } function pkcs5_pad ($text, $blocksize) { $pad = $blocksize - (strlen($text) % $blocksize); return $text . str_repeat(chr($pad), $pad); } function pkcs5_unpad($text) { $pad = ord($text{strlen($text)-1}); if ($pad > strlen($text)) { return false; } if (strspn($text, chr($pad), strlen($text) - $pad) != $pad) { return false; } return substr($text, 0, -1 * $pad); } }PHP与.NET的3DES加密代码
没有评论
2014 年 05 月 12 日 at 下午 1:10分类:PHP
<?phpif (! function_exists('mcrypt_generic_init')) {echo ('Snda needs the mcrypt_generic_init PHP extension.');exit();}if (! function_exists('mcrypt_module_ope
© 2010 - 2020 网站综合信息查询 同IP网站查询 相关类似网站查询 网站备案查询网站地图 最新查询 最近更新 优秀网站 热门网站 全部网站 同IP查询 备案查询
2025-12-22 18:47, Process in 0.0124 second.