## 4 Selective Image Encryption
### Wavelet-Based Image Coding  
This method creates a hierarchy of frequency bands coefficients called pyramid decomposition. Figure 5a presents the pyramid band image, where the number of the label indicates the level of the pyramid. Figure 5b shows the tree of coefficients. Generally, wavelet-based algorithms are based on zerotrees [56], having the advantage of grouping the insignificant coefficients within zerotrees and indicating their insignificance very efficiently.  
In a wavelet-based compression, the band of highest compression level contains the most important visual information [49]. The highest level of the pyramid is called the LLband, which is the root of the tree. Therefore, encrypting the root block of the tree and leaving levels below unsecured creates a reasonable level of protection for transmitted images. Without relevant parts of images, _i.e._, parts that contain the most important visual information, it is not possible to reconstruct original images.  
This compression method is quite similar to quadtree, but instead of being centered at homogeneity, the significance factor decides whether the data set is partitioned or not.  
An efficient algorithm for this compression paradigm is discrete wavelet transform (DWT). In summary, DWT decomposes raw images into smaller parts, called sub-bands or sub-layers, where each sub-band image has different relevance in the process of reconstructing original images [57]. Thus, each sub-band can be placed into one or more data packets, where the sub-band of greatest relevance will always have higher priority than remaining sub-bands. It is worth mentioning that by using DWT, the sub-band of greatest relevance is essential for the reconstruction of the original image, and without it, the reconstructed image is not sharp. However, only with the sub-band of greatest relevance is it possible to reconstruct images of acceptable quality, depending on the application requirements. Figure 6 shows an  
Figure 5: Image decomposition with wavelet-based coding: (**a**) hierarchy of coefficients (pyramid decomposition); (**b**) tree of wavelet coefficients [20].  
example of encoding in one and two levels using DWT compression for a sample image with 128 \(\times\) 128 pixels of resolution.  
In such a way, if we apply DWT compression and encrypt image sub-bands of the highest importance, we will be conducting a selective encryption of images. Doing so, safety would be ensured for entire images, since without the most relevant part, it is not possible to reconstruct the original sensed images. Furthermore, the combination of DWT with encryption reduces computational and communication overhead, saving resources while providing encrypted communication.  
Some recent works have addressed selective encryption in wireless multimedia sensor networks, covering relevant issues for images and video streams [58].  
The work in [59] proposes a selective encryption mechanism for video streams encoded using the MPEG-4 codec. Besides exploiting the relevance of the video frames for the reconstruction process at the destination, that proposed work reduces encryption dependency and overhead among video frames, which is particularly beneficial for transmissions over error-prone links. A cross-layer unequal error protection (UEP) approach is also adopted in [59] to enhance the performance of frame transmissions. Such a UEP-based approach is also investigated in [60], but considering image transmissions and wavelet-based coding.  
In [61], a selective encryption approach for DWT-based images is proposed. That work proposes joint compression and encryption for image transmissions in WSN. Aiming at fast encryption, the authors exploit entropy coding, the MQcoder and a lookup table for selective encryption, which assure fast encryption, even for bigger images. Doing so, only a small amount of encrypted data is generated and transmitted.