上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 63 下一页
摘要: 作为开发人员时刻要记住一句话,永远不要相信任何用户的输入!很多时候我们的网站会因为我们开发人员写的代码不够严谨,而使网站受到攻击,造成不必要的损失!下面介绍一下如何防止SQL注入! 这里提供了一个函数,用来过滤用户输入的内容!使用POST传值的时候,可以调用这个函数进行过滤! 阅读全文
posted @ 2017-09-14 11:56 ノGHJ 阅读(752) 评论(0) 推荐(0)
摘要: function remove_xss($val) { // remove all non-printable characters. CR(0a) and LF(0b) and TAB(9) are allowed // this prevents some character re-spacin 阅读全文
posted @ 2017-09-14 11:55 ノGHJ 阅读(1114) 评论(0) 推荐(0)
摘要: 通过openssl实现的签名、验签、非对称加解密,需要配合x.509证书(如crt和pem)文件使用。 测试示例 阅读全文
posted @ 2017-09-14 11:55 ノGHJ 阅读(569) 评论(0) 推荐(0)
摘要: <?php //Code By Safe3 function customError($errno, $errstr, $errfile, $errline) { echo "<b>Error number:</b> [$errno],error on line $errline in $errfi 阅读全文
posted @ 2017-09-14 11:54 ノGHJ 阅读(1531) 评论(0) 推荐(0)
摘要: PHP的AES加密类 aes.php <?php /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* AES implementation in 阅读全文
posted @ 2017-09-14 11:43 ノGHJ 阅读(480) 评论(0) 推荐(0)
摘要: php服务端与客户端交互、提供开放api时,通常需要对敏感的部分api数据传输进行数据加密,这时候rsa非对称加密就能派上用处了,下面通过一个例子来说明如何用php来实现数据的加密解密 1、加密解密的第一步是生成公钥、私钥对,私钥加密的内容能通过公钥解密(反过来亦可以) 下载开源RSA密钥生成工具o 阅读全文
posted @ 2017-09-14 11:42 ノGHJ 阅读(236) 评论(0) 推荐(0)
摘要: [PHP]代码 <?php //blog.qita.in function passport_encrypt($txt, $key) { srand((double)microtime() * 1000000); $encrypt_key = md5(rand(0, 32000)); $ctr = 阅读全文
posted @ 2017-09-14 11:41 ノGHJ 阅读(212) 评论(0) 推荐(0)
摘要: 可以逆转的加密类,没有密钥很难破解 [PHP]代码 <? class encryptCalss { var $key=12; function encode($txt){ for($i=0;$i<strlen($txt);$i++){ $txt[$i]=chr(ord($txt[$i])+$this 阅读全文
posted @ 2017-09-14 11:41 ノGHJ 阅读(901) 评论(0) 推荐(0)
摘要: [PHP]代码 阅读全文
posted @ 2017-09-14 11:40 ノGHJ 阅读(251) 评论(0) 推荐(0)
摘要: KEY 是之前定义的常量 Mcrypt::encrypt(); Mcrypt::decrypt(); 阅读全文
posted @ 2017-09-14 11:38 ノGHJ 阅读(701) 评论(0) 推荐(0)
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 63 下一页