Research Article

Reversible Fragile Watermarking Scheme for Relational Database Based on Prediction-Error Expansion

Algorithm 4

Watermark detection.
(1)Hp = HMAC (Ks ||h1||h2||…||hµ||Ks)   //Hashing of primary key hash values
(2)for each attribute Ajdo
(3)for each tuple tido
(4)  lsd = GetLSD (ti.Aj)
(5)  T = MSD (ti.Aj)
(6)   = lsd−hi   //watermarked prediction error
(7)  [i] = LSB ()   //recovering embedded bit
(8)  ti.Aj = RecoverData (T, lsd, , Wj∗[i])   //See Algorithm5
(9)end for
(10)Hj = HMAC (Hp ||t1.Aj||t2.Aj||…||tµ.Aj||Ks)   //attribute hash
(11)  //Generate watermark bits
(12)  Wj = µ MSB (Hj)   //Assume length (Hj) ≥ µ
(13)//Check integrity
(14)if Wj ≠  then
(15)  attribute Aj not authentic
(16)end if
(17)end for