## 4 Proposed Scheme for Self-Embedding
### Watermark Extraction and Reconstructing Ambtc  
In the method we proposed, the information (checksum) for its authentication is secretly concealed in the LSB, so it is possible to check whether the marked image is tampered with or forged even if there is no original image. The receiver side can find the tampered and forged block by using the validity of the checksum while moving each block. If a modulated block is found, the damaged block can be recovered according to the recovery procedure. Figure 3 shows a block diagram for the content recovery procedure. **Algorithm 4** Watermark Extracting  
**Algorithm 4** Watermark Extraction  
It extracts two maps, which are watermarks hidden in the marked image \(\mathbb{K}\). The restoration process is performed using two maps and the checksum. **Input:**: A marked image \(\mathbb{K}\) (output of Algorithm 3) with a size of \(N\times N\), Key \(\xi\). **Output:**: A reconstructed image \(\mathbb{B}\) with a size of \(N\times N\). **Step 1**: Divide the marked image \(\mathbb{K}\) into non-overlapping blocks sized \(m\times m\), where \(m=4\). The sized \(N\times N\) bitmap \(\mathbb{M}_{1}\) and \(\mathbb{M}_{2}\) are initialized with zeros. **Step 2**: Read a block from the marked image \(\mathbb{K}\), then this block is assigned to \(\mathcal{P}_{n}\), where \(n\) is a block number. After that, the embedded hidden bits in \(b_{i}^{1}\)(LSB1), \(b_{i}^{2}\)(LSB2) and \(b_{i}^{3}\)(LSB3) are obtained from the block \(\mathcal{P}_{n}\) using Equation (9). Then, a block (\(\mathcal{M}_{n,i}\)) of bitmap \(\mathbb{M}_{1}\) is restored using Equation (14). \[\mathcal{M}_{n,i}=\sum_{i=1}^{m\times m}\left[\mathcal{\bar{P}}_{n,i}/2\right] \bmod 2 \tag{14}\]  
The restored bitmap block \(\mathcal{M}_{n,i}\) is assigned to \(\mathbb{M}_{1}\), i.e., \(\mathbb{M}_{1}^{n}=\mathcal{M}_{n}\), where \(n\) is a block index. **Step 3**: After applying Equation (15) to block \(\mathcal{P}_{n}\), the obtained recovery block \(\mathcal{M}_{n,i}\) is assigned to \(\mathbb{M}_{2}\). That is, \(\mathbb{M}_{2}^{n}=\mathcal{M}_{n}\). \[\mathcal{M}_{n,i}=\sum_{i=1}^{m\times m}\left(\left[\mathcal{\bar{P}}_{n,i}/2 \right]\bmod 2\right)\oplus\left(\mathcal{\bar{P}}_{n,i}\bmod 2\right) \tag{15}\]```
1: If the procedure of Steps 2 and 3 is repeated, the number of blocks (\((N\times N)/(m\times m)\)), the two maps \(\mathbb{M}_{1}\) and \(\mathbb{M}_{2}\) are reconstructed. 2: The mapped blocks \(\mathbb{M}_{1}\) and \(\mathbb{M}_{2}\) constructed by Equation (8) are reconstructed to have their original location. For this, first, divide the bitmap \(\mathbb{M}_{1}\) and \(\mathbb{M}_{2}\) into non-overlapping blocks of \(m\times m\) pixels, where \(m=64\). Repeat Steps 5-1 and 5-2 until \(\mathbb{M}_{1}\) and \(\mathbb{M}_{2}\) are reconstructed. 3: Read a block \(\mathcal{M}_{n}\) from \(\mathbb{M}_{1}\), where \(n\in\{1\leq n\leq(N\times N)/(m\times m)\}\). Obtain an index of two blocks needed to be exchanged applying \(\mathbb{M}_{1}\) to Equation (8). That is, \(j=\sum_{n=1}f(\mathcal{M}_{n},\xi,n)\) where \(f\) is the function of the rule of Equation (8) and \(\xi\) is the key. Here, the indexes \(n\) and \(j\) are the indexes of the blocks to be exchanged. Swap the values of the block \(\mathcal{M}_{n}\) and the block \(\mathcal{M}_{j}\) in the map \(\mathbb{M}_{1}\). When the blocks corresponding to the two positions are exchanged, the original positions are returned. 4: Read a block \(\mathcal{M}_{n}\) from \(\mathbb{M}_{2}\), where \(n\in\{1\leq n\leq(N\times N)/(m\times m)\}\). Obtain an index to exchange two blocks applying Equation (8) to \(\mathbb{M}_{1}\). That is, \(j=\sum_{n=1}f(\mathcal{M}_{n},\xi,n)\). Swap the values of the block \(\mathcal{M}_{n}\) and the block \(\mathcal{M}_{j}\) in the map \(\mathbb{M}_{2}\). 5: Divide the bitmap \(\mathbb{M}_{1}\) and \(\mathbb{M}_{2}\) into non-overlapping blocks of \(m\times m\) pixels, where \(m=4\). The sized \(N\times N\) AMBTC grayscale image \(\mathbb{B}\) are initialized with zeros.