# Facial Privacy Protection with Dynamic Multi-User Access Control for Online Photo Platforms
## 3 Preliminaries
### Selective Image Encryption  
Selective image encryption differs from traditional methods, such as AES, by taking the image file's structure into account. Conventional encryption algorithms treat an image as a generic data stream, making the encrypted output unreadable by standard image viewers. Because these methods disregard the original file structure, necessary modifications can be easily performed before encryption to ensure the plaintext complies with algorithmic requirements. However, in selective image encryption, preserving the file structure is essential, making such modifications more challenging or even impractical. For instance, the AES algorithm employs padding to adjust the plaintext size to match its required block size of 16 bytes. While this ensures compliance with AES encryption standards, it can disrupt the structure of image data, making the encrypted output incompatible with standard image encoding formats. This limitation underscores the need for specialized image encryption techniques that preserve structural integrity while maintaining usability in common image viewers. Some existing image encryption methods produce encrypted images that remain viewable. Recent research has proposed various encryption techniques incorporating methods such as Hilbert curve scrambling, Discrete Wavelet Transform (DWT), and dynamic DNA coding to ensure pixel-level security [28]; fractal geometry combined with chaotic maps and Paillier homomorphic encryption [29]; and chaotic synchronization systems enhanced by Radial Basis Function Neural Networks (RBFNN) and Particle Swarm Optimization (PSO) [30]. However, these approaches typically encrypt the entire image. While full-image encryption is essential for protecting sensitive data, there are scenarios where selective encryption of specific regions is more appropriate [17]. For example, in online photo sharing, users may prefer to encrypt only sensitive areas while leaving non-sensitive regions unaltered. Encrypting an entire image presents a challenge in balancing security and usability. Although the image remains viewable in a standard viewer, it appears as noise and is incomprehensible to the human eye. In contrast, selective encryption of an image encrypts specific regions while preserving the interpretability of the non-sensitive areas. Our work in SnapSafe [17] introduced a method to selectively encrypt sensitive facial regions in an image, ensuring that facial data remain secure while the rest of the image remains usable for sharing. This approach is particularly suitable for online platforms where sharing visual information is essential while maintaining privacy protection. However, implementing selective image encryption effectively requires addressing several challenges. First, encrypted regions must be compatible with reintegration  
Figure 2: Overview of YOLOv8 architecture. into the original image without disrupting its structure. Additionally, the approach should support encryption of rectangular regions of varying sizes, as sensitive areas in images can differ in dimensions and location. For example, the method proposed by [PERSON] et al. (2018) is unsuitable for this purpose due to its reliance on Hilbert curve scrambling and DWT decomposition, which only support square regions. This limitation makes it infeasible for encrypting arbitrary rectangular areas, such as those detected using object detection algorithms. Our previous work [17] introduced an algorithm to overcome this challenge by adjusting the bounding box of the image segment prior to AES encryption. This adjustment ensures that the byte size of the region is a multiple of 16 bytes, eliminating the need for padding and facilitating seamless reintegration into the original image. Since the encrypted data maintain structural compatibility with standard image formats, this approach enables selective encryption without introducing compatibility issues.