# Hamming Code Strategy for Medical Image Sharing
## 3 Hamming Codes
### Discussions  
Next, we discuss the following issues of our scheme more in detail: (1) compromised shadows (2) why use (7,11) and (15,11) Hamming codes in our scheme, and (3) why not just use a scrambling algorithm to get a less distorted shadow in our scheme. Compromised shadow images:  
The proposed scheme is a user-friendly like secret image sharing scheme [37; 38; 39; 40], in which the shadow represents a distorted version of the original image. One can see a blurred medical image and can combine two shadows to reveal the original images. However, what will happen if shadows are compromised (e.g., attacked and compromised by geometric distortion, compression, filtering, and other image processing)? Because of the threshold condition, the original medical image will not be recovered when any one shadow is compromised. No measure can be taken to avoid this. Actually, this is not a disadvantage. It is to assure the security of a (2,2) scheme because our goal is to prevent the patients' health information from being leaked via (2,2) a secret sharing scheme. Why using (7,11) and (15,11) Hamming codes in our scheme:  
BCH codes have the following parameters: block length \(n=2m-1\), number of parity bits \((n-k)\)\(\leq mt\), and the minimum distance \(d_{\min}=2t+1\), where \(m\) (\(m\geq 3\)) is a positive integer and t is the error correcting capability. Actually, BCH code is a generalization of the Hamming code. For \(t=1\), a BCH \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Methods**} & \multicolumn{4}{c}{**Time (s)**} \\ \cline{2-5}  & **(MSBSs)** & **Creating Shadow (s)** &
\begin{tabular}{c} **Reconstructing** \\ **Original Images (s)** \\ \end{tabular} & **Execution Time (s)** \\ \hline \multirow{4}{*}{(7,4) Hamming code} & Pair 1 & 0.6060 & 0.6104 & 1.2164 \\  & Pair 2 & 0.6653 & 0.6711 & 1.3364 \\  & Pair 3 & 0.6507 & 0.6576 & 1.3083 \\  & Pair 4 & 0.6344 & 0.6908 & 1.3252 \\  & Pair 1 & 0.7054 & 0.8147 & 1.5201 \\ \multirow{4}{*}{(15,11) Hamming code} & Pair 2 & 0.7534 & 0.8403 & 1.5937 \\  & Pair 3 & 0.6996 & 0.8011 & 1.5007 \\ \cline{1-1}  & Pair 4 & 0.7704 & 0.8715 & 1.6419 \\ \cline{1-1}  & Average & 0.6857 & 0.7447 & 1.4303 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Experimental results of execution time (s) for our proposed schemes. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Features** & Ref. [31] & Ref. [34] & Ref. [32] & Ref. [37] & Ours (MSBs) \\
**Kernel** & Magic matrix & Random grid & \
\begin{tabular}{c} DNA \\ cryptography \\ \end{tabular} & Polynomial &
\begin{tabular}{c} Hamming \\ code \\ \end{tabular} \\
**Average Execution Time (s)** & 1.38 & 0.18 & - & - & 0.69 \\
**Visual Perception (PSNR)** & 51.72/45.70 & - & 46.8–47 & \textless{}30 & 19.15/18.47 \\
**Non-Expanded Pixel** & Yes & Yes & No & Yes & Yes \\
**Lossless Recovery** & Yes & Yes & Yes & No & Yes \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparison of various features for different schemes. code is the Hamming code with \(n=2m-1\), \((n-k)=m\), and \(d_{\min}=3\). Our approach deals with two pixels \(P_{1}\) and \(P_{2}\) simultaneously. There are a total of 16 bits in the pair (\(P_{1}\) and \(P_{2}\)). Thus, BCH codes with \(m\geq 5\) having block length \(n\geq 31\) larger than 16 cannot be used in our two-pixel approach. BCH code with \(m=3\) is the (7,4) Hamming code. For \(m\)=4, there are three BCH codes with \(t=1\), 2 and 3, respectively. Note: for \(t=1\), it is the (15,11) Hamming code. On the other hand, for \(t=2\) and 3, the codes are (15,7) BCH code and (15,5) BCH code. Next, we describe why we do not use (15,7) BCH code and (15,5) BCH code. If we adopt these two codes in our scheme, we should flip at most two bits (there are \(\left( \begin{array}{c}15\\ 0\end{array} \right)+\left( \begin{array}{c}15\\ 1\end{array} \right)+\left( \begin{array}{c}15\\ 2\end{array} \right)=121\) ways to determine the positions) for (15,7) BCH code., and at most three bits (there are \(\left( \begin{array}{c}15\\ 0\end{array} \right)+\left(