Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我被28題 Hash搞瘋了,誰能幫幫我,差這題就通過了 #541

Open
kevintsai1202 opened this issue Sep 20, 2023 · 2 comments
Open

Comments

@kevintsai1202
Copy link

不管怎麼做都是80分, 幫我看哪有問題吧@@

  1. 哈希函数(hash function)是一个密码学概念,它可以将任意长度的消息转换为一个固定长度的值,这个值也称作哈希(hash)。
    在Solidity语言中,最常用的哈希函数为____,它也是函数选择器所应用的函数。keccak-256 (這題答案很怪,最常用的是keccak256,但是只有sha256能正確執行,題目筆誤?)
  2. 一个好的哈希函数应当包含以下几种特性:单向性、灵敏性、高效性、均一性、抗碰撞性。
    下列关于这些特性中,描述不正确的一项是:对于一个哈希函数而言,强抗碰撞性比弱抗碰撞性更难满足
  3. 【原题已修改】如果对于某个哈希函数,我们统计大量不同字符串对应的哈希值(二进制串),发现其前 n 位全部为 0 的频率恰好约为 1/2^n,则我们认为该哈希函数具有良好的:均一性
  4. 我们对两个非常相近的字符串 "Hello world!" 和 "Hello world." 求取 sha3-256 哈希值,其结果如下:
    sha3-256("Hello world!") = 0xd6ea8f9a1f22e1298e5a9506bd066f23cc56001f5d36582344a628649df53ae8
    sha3-256("Hello world.") = 0x28c9b96bc1e7fcda7f3356693de2a1781e25d76c468fc75b56450df4f25ca962
    可以看到两者的结果相差极大。这主要归功于sha3-256良好的:灵敏性
  5. 当我们下载大型文件时,有时候下载源会提供大型文件的哈希值;我们下载完成后,将本地下载好的大文件也计算其哈希值,并将两个哈希值对比。以下说法不准确的是:如果哈希值相同,说明文件的内容一定完全相同,下载过程没有出现问题
@Ruiz000
Copy link

Ruiz000 commented Nov 8, 2023

错在题二,对于强抗碰撞性理解有误。

@XdpCs
Copy link
Contributor

XdpCs commented Nov 15, 2023

强抗碰撞性是指要找到散列值相同的两条不同的消息是非常困难的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants