top of page
  • Writer's picture老 9

讀書報告(五) Hashing Function #雜湊函式

很多人都誤解了 #雜湊演算法 Cryptographic #hashing 並不是 #加密encryption。加密是你可以有方法解密的,但Hushing Function是單向的,並不能使輸入的資料復原。 舉例說:將Peter經過一個打指紋程序(hushing Function),得出他的指紋(Hush Value),你可用指紋去確認Peter,那是很準確的,但你不能用指紋去重建Peter,不能重建的原因是因為Hashing Function令很多的資料失去。


最簡單的例子: 36006 MOD 24 = 6 (Modular Arithmetic) 結果是6,但我們就是知道 Hushing Function H(x)=x Mod 24,也不容易還原輸入的36006,除非用 #蠻力 (Brute Force),即是第1個解是30,第2個是54,第3個是78…直至找到答案。(試想如果是一個很大的數值) and 1001 XOR 0011 = 0101 ( #XOR Arithmetic) 結果第1個0你不是是第1個數值是1還是第2個,同樣第4個1,我們也不知是來自2個0還是2個1。這樣就很難還原。


好的Hushing Function 有以下的特點: 能很快算出來 (Fast) 相同的輸入得出相同的輸出值 (Deterministic) 不能重建原本的輸入 (One-Way) 不能於改動後能得同一輸出 (Secure) 不會有不同的輸入得出相同的輸出 (Collision resistant)


#比特幣( #Bitcoin)用SHA-256,#以太坊(#Ethereum)用SHA-3 這連結可計算出 SHA-256 和其他常用的Hush https://emn178.github.io/online-tools/sha256.html


例用為『#老9讀書報告』進行SHA-256 Hush 得出: 481cade9610775b7bfe047610099620a0c3d784e1268037bc416d630e149fd48


5 views0 comments
bottom of page