1. 程式人生 > >密碼學Hash函式 Cryptographic Hash Functions #11

密碼學Hash函式 Cryptographic Hash Functions #11

需要掌握的內容如下:

  • Two simple hash functions
  • Hash functions based on cipher block chaining 
  • SHA(Secure hash algorithms)

 

Condenses壓縮 arbitrary message to fixed size:   h=H(M)

 

Good hash function 特徵

  • Evenly distributed 
  • Apparently random 

 

Object: data integrity 資料完整性

--Used to detect changes to message

 

  • One-way property 

----Computationally 計算上 infeasible不可行的to find data mapping to specific hash

  • Collsion-free property 

----Computationally infeasible to find two data to same hash

 

Hash應用在哪些方面?

  • Message authentication
  • Digital signature 數字簽名

 

 

Hash Functions & Digital Signatures

 

Two simple Insecure Hash Functions:

  • Bit-by-bit exclusive-OR(XOR) of every block

Known as a longitudinal縱向的 redundancy check

  •  Rotated XOR: one-bit circular shift on hash value 旋轉的

Randomizing the input and overcoming any regularities that appear in the input,

good for data integrity but useless for security when an encrypted hash code is used with a plaintext message,

easy to find a new message that yields that hash code.

 

Security Requirements

  • for a hash function h=H(x)
  • a collision occurs if we have x!=y and H(x)=H(y)

if the length of the hash code is n bits, and input data block is b bits(b>n), each hash value corresponds to 2^(b-n) 

 

Atttack on Hash Functions

  • Brute-force attacks and cryptanalysis  暴力攻擊和密碼分析
  • a preimage or second preimage attack