Research Article

Mimic Encryption Box for Network Multimedia Data Security

Algorithm 2

Extended Euclidean modular inversion.
Input: a, b, p
Output: c = b/a mod p
(1)u = a;  = p; x1 = b; x2 = 0;
(2)while ( > 0)
(3) if (u[1 : 0] = = 2′b00)
(4)  ; ;
(5) else if ([1 : 0] = = 2′b00)
(6)  ; ;
(7) else if (u[1 : 0] = = [1 : 0])
(8)  if (u > ) ;
(9)  ;
(10)  else ;
(11)  ;
(12) else if (u[1 : 0] = = 2′b10)
(13)  if ((u >> 1) > ) ;
(14)  ;
(15)  else ; ;
(16)  ;
(17)  ;
(18) else if ([1 : 0] = = 2′b10)
(19)  if (u > ( >> 1)) ;
(20)  ;
(21)  ; ;
(22)  else ;
(23)  ;
(24) else if (u ≥ )
(25)  ; ;
(26) else
(27)  ; ;
(28)endwhile
(29)return c = x1;