关于PHP网络验证被破。解的可能性探讨

关于PHP网络验证被破。解的可能性探讨,第1张

如果所谓的脚本也是在服务器端的话,我不知道算来算去是啥意思,如果是指客户端(浏览器javascript)我也不知道什么意思,发个随机数验证码卜升告吗?用来做SessionID还差不多,不过就算是这样也没必要型明MD5算来算去,基本没有意义,别人能拿到你的MD5吗?除非攻破服务器。

======

请说明清楚笑闭

用途是给易语言和按键精灵所写的游戏脚本的进行注册码远程授权

dll动态链接库

基于ThinkPHP3.2的非前后端分离Web

服务端(php)介绍:

客户端(dll)介绍:

https://github.com/HJaycee/Signxx

<?php

 //将验证码保存到session里,供全局使用

 肢滚session_start()

 $nums = 

""

 for($i=0$i<4$i++){

  //产芦或生随机数并转换成十六进制

  $nums.=dechex(mt_rand(0,15))

 }

 //将验证码写入session

 $_SESSION['code']=$nums

 //设置验证码长和宽

 $_width 

= 60

 $_height = 20

 //创建一张图片

 $_img = 

imagecreatetruecolor($_width,$_height)

 //创建一个白色

 $_white = 

imagecolorallocate($_img,220,250,250)

 //填充背景

 imagefill($_img,0,0,$_white)

 //随机画6条线条

 for($i=0$i<6$i++){

  $_rnd_color 

imagecolorallocate($_img,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255))

  imageline($_img,mt_rand(0,$_width),mt_rand(0,$_width),mt_rand(0,$_width),mt_rand(0,$_width),$_rnd_color)

 }

 //随机画出雪花

 for($i=0$i<60$i++){

  imagestring($_img,1,mt_rand(1,$_width),mt_rand(1,$_height),"*",imagecolorallocate($_img,mt_rand(200,255),mt_rand(200,255),mt_rand(200,255)))

 }

 //输出验证码

 for($i=0$i<strlen($_SESSION['历哗余code'])$i++){

  imagestring($_img,mt_rand(6,10),$i*$_width/4+mt_rand(1,10),mt_rand(1,$_height/2),$_SESSION['code'][$i],imagecolorallocate($_img,mt_rand(0,100),mt_rand(0,150),mt_rand(0,200)))

 }

 //输出和销毁

 header("Content-Type:image/png")

 imagepng($_img)

 imagedestroy($_img)

?>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/8247044.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-14
下一篇 2023-04-14

发表评论

登录后才能评论

评论列表(0条)

保存