前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >哈希竞猜游戏系统开发(案例开发源码)

哈希竞猜游戏系统开发(案例开发源码)

原创
作者头像
VC_MrsFu123
发布2022-06-30 15:46:34
7650
发布2022-06-30 15:46:34
举报
文章被收录于专栏:用户9868391的专栏

  哈希函数特点

  1.确定性

  如果两个哈希值不相同(根据同一函数),那么这两个哈希值的原始输入也是不相同的。

  2.散列碰撞

  哈希函数的输入和输出不是唯一对应关系的,如果两个哈希值相同,两个输入值很可能是相同的,但也可能不同。

  3.不可逆性

  哈希函数是一个单向密码体制,即从明文到密文的不可逆映射,只有加密过程没有解密过程。

  4.混淆特性

  输入一些数据计算出哈希值,然后部分改变输入值,一个具有强混淆特性的哈希函数会产生一个完全不同的哈希值。

  哈希简单的理解,就是把一串长的数据变成一串短的数据,它有三个特点:

  First,it is unidirectional.

  We can only calculate long data into a short hash.We can't deduce the original data from the hash.Many people are curious about how the blockchain is formed.For example,after the block is packaged,a hash will be calculated for the block,and the hash will be stored in the next block.The hash in the next block will lock the previous block.This is the traditional hash locking,The immutability of the blockchain comes from this.Because the previous block is changed,the hash in the subsequent block cannot be mapped.Therefore,the blockchain is the content locking of each block to the previous block,which is called hash locking.

  Second,hash is unique.

  The uniqueness of hash is that we turn a long data into a hash data,and each long data turns into a unique corresponding hash data.However,this sentence is problematic,because turning a long data into a short data or a long file into a short hash has a certain probability in science that it will form the same hash,but the probability is very low,This is how hashes are unique.

  Third,hash is discrete.

  Discreteness refers to two files that are very close to each other,or a long data that is only one digit different from each other.The hash values we calculate are vastly different and have no similarities.The discreteness of hash is mainly to avoid some characteristic attacks.

  常用哈希算法

  1.MD4

  MD4(RFC 1320)是MIT的Ronald L.Rivest在1990年设计的,MD是Message Digest(消息摘要)的缩写。哈希开发MrsFu123它适用在32位字长的处理器上用高速软件实现——它是基于32位操作数的位操作来实现的。

  2.MD5

  MD5(RFC 1321)是Rivest于1991年对MD4的改进版本。它对输入仍以512位分组,其输出是4个32位字的级联,与MD4相同。MD5比MD4来得复杂,并且速度较之要慢一点,但更安全,在抗分析和抗差分方面表现更好。

  3.SHA-1

  SHA1是由NIST NSA设计为同DSA一起使用的,它对长度小于264的输入,产生长度为160bit的散列值,因此抗穷举(brute-force)性更好。SHA-1设计时基于和MD4相同原理,并且模仿了该算法。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
网站建设
网站建设(Website Design Service,WDS),是帮助您快速搭建企业网站的服务。通过自助模板建站工具及专业设计服务,无需了解代码技术,即可自由拖拽模块,可视化完成网站管理。全功能管理后台操作方便,一次更新,数据多端同步,省时省心。使用网站建设服务,您无需维持技术和设计师团队,即可快速实现网站上线,达到企业数字化转型的目的。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档