我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

php中的加密/验证功能

There is a form with 2 fields: X and Y. X is known, Y is generated later via ajax based on X. After the submit I would like to check if Y was generated by me or not.

I'm looking for a function (and its inverse) that is more complicated to figure out than the example below:

x = 7 (random number)
y = f(x)
x = g(y)

example:
f = +2
g = -2

x = 7
y = 9
x = 7

Why not use f(x) again and check its output against the posted value of y? That way you are even able to make irreversible valies for y (like md5 or sha)?

近期文章

  • PHP使用imagecopyresampled保留exif数据
  • 如何查找php脚本的内存消耗?
  • codeigniter电子邮件变量无法显示
  • 简单的HTML DOM解析器与Chrome Source Viewer不同?
  • 将元素附加到多维数组php中的数组?
  • PHP Regex匹配特定的css类名+:before伪
  • 从自定义帖子类型中按ID获取类别名称
  • 使用php显示mysql的所有结果的问题
  • 如何使用Laravel中的Eloquent为同一两个表创建不同的多对多关系
  • 如果他通过手机登录到网站,如果从PC登录到另一个页面,如何将访问者切换到页面?
  • 将内容保存到数组中[关闭]
  • CakePHP Auth Facebook Connect无法正常工作(无插件)
  • 用PHP的Javascript表单发布
  • pdf下载文件名称问题
  • 从url获取php输出
  • Highcharts - 解析json系列
  • PHP上传失败
  • .tpl文件出错
  • 如何给php中的类成员赋值
  • reCaptcha没有在注册页面上工作

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华