Next Article in Journal
A Comparative Study of Convolutional Neural Network and Recurrent Neural Network Models for the Analysis of Cardiac Arrest Rhythms During Cardiopulmonary Resuscitation
Previous Article in Journal
Dynamic Balance Correction of Active Magnetic Bearing Rotor Based on Adaptive Notch Filter and Influence Coefficient Method
Previous Article in Special Issue
Supervised Blockchain Anonymous Transaction Model Based on Certificateless Signcryption
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Integrating Visual Cryptography for Efficient and Secure Image Sharing on Social Networks

1
Institute of Artificial Intelligence, Guangdong Mechanical & Electrical Polytechnic, Guangzhou 510555, China
2
Cyberspace Institute of Advanced Technology, Guangzhou University, Guangzhou 510555, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2025, 15(8), 4150; https://doi.org/10.3390/app15084150
Submission received: 4 March 2025 / Revised: 26 March 2025 / Accepted: 27 March 2025 / Published: 9 April 2025
(This article belongs to the Special Issue Novel Insights into Cryptography and Network Security)

Abstract

:
The widespread use of smart devices, such as phones and live-streaming cameras, has ushered in an era where digital images can be captured and shared on social networks anytime and anywhere. Sharing images demands more bandwidth and stricter security than text. This prevalence poses challenges for secure image forwarding, as it is susceptible to privacy leaks when sharing data. While standard encryption algorithms can safeguard the privacy of textual data, image data entail larger volumes and significant redundancy. The limited computing power of smart devices complicates the encrypted transmission of images, creating substantial obstacles to implementing security policies on low-computing devices. To address privacy concerns regarding image sharing on social networks, we propose a lightweight data forwarding mechanism for resource-constrained environments. By integrating large-scale data forwarding with visual cryptography, we enhance data security and resource utilization while minimizing overhead. We introduce a downsampling-based non-expansive scheme to reduce pixel expansion and decrease encrypted image size without compromising decryption quality. Experimental results demonstrate that our method achieves a peak signal-to-noise ratio of up to 20.54 dB, and a structural similarity index of 0.72, outperforming existing methods such as random-grid. Our approach prevents size expansion while maintaining high decryption quality, addressing access control gaps, and enabling secure and efficient data exchange between interconnected systems.

1. Introduction

The rapid advancement of image processing technology and the widespread use of audio and video capture equipment in the Internet of Things (IoT) drive exponential growth in multimedia data in the digital era. Digital images are now a key multimedia information source in work, communication, and personal sharing due to their readability, capacity, and accessibility. They are extensively used in national defense, industry, healthcare, and everyday life. The growth of mobile devices and social media platforms has greatly improved personal and professional experiences [1]. Smart devices are inherently constrained in critical resources including computing power and bandwidth. Security is paramount in preventing unauthorized access and data breaches during the aggregation and transmission of perceptual data. The pervasive interconnection of smart terminals facilitates the collection of vast amounts of data anywhere and anytime. These platforms can record, spread, and share massive images in real time, which has promoted the convergence of the real world and the internet. However, the open network environment also provides great convenience for illegal activities such as data theft, malicious tampering, and intentional dissemination, aggravating the security threat of multimedia content [2].
The widespread adoption of social media platforms has revolutionized image sharing but also introduces critical security challenges [3]. The bandwidth demands and security needs of image data far surpass those of text. While ubiquitous devices simplify image capture and distribution, their resource constraints limit the implementation of robust security. Traditional text-based encryption methods are inadequate for the volume and redundancy inherent in image data, increasing the risk of privacy breaches during transmission and storage [4]. Resource-efficient solutions are crucial for secure image sharing. Balancing the benefits of large-scale data usage with personal privacy is a major obstacle to widespread adoption. Digital images, often containing sensitive information, are vulnerable to interception, tampering, and theft on public networks. Securing image transmission, application, and storage is a key challenge in information security. The limited communication range in sensor networks necessitates multi-hop communication, creating vulnerabilities where malicious nodes can compromise data integrity. Maintaining confidentiality, integrity, and availability during sensitive data transmission is vital. The miniaturization of devices complicates complex encryption, and the lack of unified security mechanisms in complex social networks increases vulnerability to attacks and privacy breaches. Leaked information can lead to significant losses. These resource limitations and security vulnerabilities impede secure image sharing on social networks [5].
Cryptography involves encrypting data before sending and decrypting them on the receiver. Data are encrypted mathematically so that they can only be decrypted by legitimate users [6]. As digital technology evolves, social networks integrate into a vast network encompassing innumerable miniature devices. This enables the provision of integrated sensing and communications services to homes, factories, cities, and governments with smart devices, sensors, and autonomous applications. Before uploading sensing images to the cloud platform, it is important to encrypt and store them.
Visual cryptography (VC) is a secret-sharing (SS) scheme that encrypts binary images without complex computations [4,7]. It divides the secret image into shares, which are then combined by the receiver to unveil the secret. This ensures perfect security without the need for cryptographic expertise. Researchers have created various VC schemes (VCSs) of grayscale and color images based on black-and-white images, maintaining the benefits while ensuring compatibility with earlier research. VC can be used in text and image encryption, enabling decryption by the human visual system (HVS) without computer assistance. This contrasts with image steganography, emphasizing watermark decoding with optimized fidelity and no security constraints.
VC still faces challenges such as size expansion and decreased quality of decrypted images [8]. The expansion will enlarge the carrier load, leading to excessive resource consumption for information protection. Image sharing on social networks is characterized by large sizes, high volumes, and slow transmission speeds. While data encryption is valuable, it often lacks compression capabilities [9]. However, this issue becomes significant with larger images since encryption often involves multiple images or shares. If unauthorized users notice these data due to noise in the ciphertext, they may attempt to decrypt or analyze these data, which would pose a threat to data protection.
To address the above issues, this paper presents a secure and energy-efficient framework with VC to enhance privacy and security for communication in energy-sensitive environments. Image sharing faces substantial challenges in the IoT era with the proliferation of lightweight, miniaturized devices in open and public networks. These devices cannot support complex cryptographic algorithms due to strict power and weight constraints, increasing their vulnerability to security risks and data leaks. The primary contributions of this paper are as follows:
  • The introduction of a secret-sharing-based data forwarding and sharing model, which facilitates the real-time transmission of vast amounts of sensitive data from IoT terminals.
  • The proposal of a downsampling-based non-expansive VCS to reduce encrypted image size and preserve decryption quality.
  • The conducting of comprehensive experiments on classic test images demonstrates that our proposed framework achieves comparable recognition performance on encrypted datasets to that on plain datasets.
The paper is structured as follows: Section 2 reviews related works, Section 3 describes the proposed methods for encrypted image generation and decrypted image enhancement, and Section 4 presents the experimental results, demonstrating the effectiveness, efficiency, and security of the proposed framework for secure image transmission. Finally, Section 5 concludes with future work.

2. Background and Related Works

2.1. Background

Traditional security mechanisms are resource-intensive, making reliable transmission challenging. Given the vulnerability of images to security attacks due to resource constraints, image encryption is crucial for visual privacy and security. Existing encryption techniques aim to secure communication between sensors. Asymmetric encryption methods are often impractical due to sensor resource limitations. Recent developments in Elliptic Curve Cryptography (ECC) have lowered computational costs but still require Public Key Infrastructure (PKI) support. Symmetric encryption algorithms necessitate an initial shared key between adjacent sensor pairs, presenting significant challenges for secure and efficient key distribution. While disseminating each sensor’s key to neighboring nodes is a straightforward method, it can become complex and inefficient in social networks. The unique appearance of encrypted images may intrigue unauthorized users during transmission, heightening the risk of exposure. Given that sensors use wireless communication, any entity within the transmission can potentially intercept data, compromising the privacy of exchanged information [10].
VC is a method that utilizes the characteristics of HVS to decrypt encrypted images. Compared to other cryptographic schemes that rely on complex calculations, VC offers greater security and convenience. The core idea is to divide a secret image into multiple random shares, each of which contains no information about the original image. Secret sharing is one of the basic primitives of cryptography, which decentralizes the management of core secrets and keys, reducing the risk of theft and tolerating attacks. VC has applications in key negotiation, secure multi-party computation, digital signatures, transfer systems, and voting systems. During decryption, the encrypted shares are printed on transparent film and overlapped. The secret information from the original image can then be recovered through the HVS. Visually meaningful image encryption is a key topic in information security, aiming to balance image privacy and usability. Unlike traditional schemes that prioritize privacy while neglecting usability, VC ensures the security of image content and visual appearance. The ciphertext protects privacy while remaining visually appealing. This approach meets practical needs and provides new insights into information security.
The VC encrypts a black-and-white secret image into n shares for distribution. The threshold property of SS ensures that the secret image can only be recovered when two or more participants stack their respective shares together. If a pixel to be encrypted is black (represented by 1), the corresponding pixels in the cover image are 1 and 0 (with white representing 0). The encrypted matrix can be obtained by permuting any column of the base matrix. VC offers a lightweight and secure image forwarding scheme by merging image processing and cryptography. Its threshold property ensures that encrypted images reveal no information about the original. As shown in Figure 1, each pixel in the secret image is divided into shares using a mathematical process based on basis matrices and column permutations. The black pixels in the shares are irreversible, leading to a loss of contrast and brightness in the decrypted image.
The matrices S i , i { 0 , 1 } are basis matrices; we can obtain encryption collections C i by permuting the columns of S i in all possible ways. The basis matrices and the collections of the encoding matrices in the conventional 2 × 2 -VCS can be written in Equations (1)–(3):
S 0 = 0 1 0 1 , S 1 = 0 1 1 0
C 0 = 0 1 0 1 , 1 0 1 0
C 1 = 0 1 1 0 , 1 0 0 1
where the pixel expansion is m = 2 . For any matrix M C 0 , the row vector V 0 = OR r 01 , r 02 satisfies w V 0 = 1 , where w is the Hamming weight. For any M C 1 , the row vector V 1 = OR r 11 , r 12 satisfies w V 1 = 2 . The classic ( 2 × 2 ) -VCS can be implemented by permuting two collections. The security of our method is grounded in the foundational work of Naor and Shamir [11]. The secret image can only be recovered when a sufficient number of shares are combined. No single share contains any information about the original image, making it impossible to reconstruct the secret from fewer than the required number of shares. The basis matrices are designed such that the combination of shares corresponding to a black pixel results in a black pixel, while the combination of shares corresponding to a white pixel results in a white pixel. This property ensures that the secret image is only revealed when the correct shares are combined.

2.2. Related Works

Ghawa et al. [12] introduced a lightweight secure aggregation and transmission scheme (SATS) for secure and lightweight data computation and transmission. SATS utilizes lightweight X O R operations to obtain batch keys instead of expensive multiplication operations. Traditional resizing methods, such as linear and cubic interpolation, are common in image preprocessing. Talebi et al. [13] explored a learnable resizer to enhance network performance. However, this emphasis on recognition neglects the visual quality, resulting in significantly distorted resized images. The Voronoi-based VC [14] leverages Voronoi tessellation to minimize the data encoded and transmitted, offering advantages over traditional VC schemes. This technique is especially beneficial for secret image transmission in bandwidth-limited and memory-restricted networks because it increases information redundancy and enhances transmission reliability.
VC simplifies encryption by eliminating complex computations and key dependencies, making it a suitable alternative for low-computing power environments. Zhang et al. [15] apply the adaptive brightness adjustment to reduce all-white pixel frequency in unencryptable all-white blocks, which addresses secret-patch correspondence and mitigates size expansion and contrast loss in the restored image. However, the increase in shares increases the transmission bandwidth. By selecting the number of colors in the reconstructed image, Wu et al. [16] eliminated the halftoning preprocessing by probabilistic techniques and color channel separation, failing to perfectly recover white secret pixels and potentially sacrificing contrast, with a contrast ceiling of 1 / 4 . Zhang et al. [17] proposed a lightweight privacy-preserving system for remote sensing images with VC, combined with denoising neural networks to improve decryption quality and recognition accuracy.

3. Proposed Method

Image encryption is crucial for image security, often making images unrecognizable, thereby safeguarding visual privacy and sensitive information. This is vital in contexts including the transmission and storage of medical images, personal photos, commercial secrets, and military images. However, traditional image encryption methods present significant challenges. Encrypted images often exhibit notable randomness and confusion, which can attract the curiosity of unauthorized users when transmitted over open channels like the Internet. Even with encrypted content, the mere existence of the image poses a potential security threat, as attackers might attempt to decipher it for curiosity or other motives.
The main ideas behind the privacy-preserving framework are resize-preprocessing and pixel expansion elimination.

3.1. Pregeneration of Encrypted Images

VC requires converting images into binary images for encryption. The halftone algorithm transforms continuous-tone images into binary images. Taking grayscale images as an example, the algorithm transforms the pixel values of the image from continuous to discrete, representing the image with only white or black pixels. The most common halftoning algorithm is error diffusion (ED) [18]. Different from the standard binary image, a halftone image can appear continuous-tone when viewed from a distance due to the low filtering capability of the human visual system. This algorithm reduces the loss of image details by diffusing the error of the current pixel to surrounding pixels in a specific ratio.
For an I image in grayscale, we obtain an I h image in corresponding halftones by minimizing the following objective function in Equation (4):
Obj I , I h = w g G I , I h + w t 1 MSSIM I , I h
where G(I, I h ) measures the similarity of the original and halftone images, and  M S S I M (I, I h ) measures the average structure similarity. w t and w g are weighting factors that balance the contributions of structural similarity and tone preservation to the overall quality score. The values of the w t and w g are 0.2 and 0.3, respectively. Homogenization can start with any 2D image that matches the overall grayscale ratio of the original image. This involves randomly dispersing black and white pixels while maintaining the global grayscale. To accelerate convergence, outcomes from established halftoning methods like ED are utilized. The Structural Similarity Index Measure (SSIM) quantitatively assesses structural differences between the halftone output and the original grayscale image. SSIM evaluates localized structural similarity in the neighborhoods of corresponding pixel pairs from the two images, with an 11 × 11 window. It breaks down similarity evaluation into three components: luminance l ( x , y ) , contrast c ( x , y ) , and structure s ( x , y ) .
Assuming x and y are two non-negative aligned images, each with N elements, we first compare their brightness. This is estimated with the weighted average intensity, μ x = i = 1 N ω i x i , typically with a normalized Gaussian weighting for ω i . The brightness comparison function, l ( x , y ) , depends on μ x and μ y , as shown in Equation (5):
l ( x , y ) = 2 μ x μ y + k 1 μ x 2 + μ y 2 + k 1
where k 1 is a small constant to avoid singularity. There is a similar definition for contrast c (x, y). As shown in Equation (6), it takes standard deviations σ x and σ y as estimates of signal contrast.
c ( x , y ) = 2 σ x σ y + κ 2 σ x 2 + σ y 2 + κ 2 , σ x = i = 1 N ω i ( x i μ x ) 2 1 2
where κ 2 is a small constant that prevents singularity. Image correlation serves as an effective metric for assessing structural similarity. We can define it in Equation (7):
s ( x , y ) = σ x y + κ 3 σ x σ y + κ 3 , σ x y = i = 1 N ω i ( x i μ x ) ( y i μ y )
where σ x y defines the inner product, and  k 3 is a small constant avoiding singularity. k 1 and k 2 are usually set to 0.01 and 0.03, while k 3 = k 2 / 2 = 0.015 .
The SSIM value ranges between −1 and 1, where a value of 1 indicates perfect similarity. SSIM is defined in Equation (8):
SSIM ( x , y ) = l ( x , y ) · c ( x , y ) · s ( x , y )
Changes in brightness or contrast do not affect the structure of images. The mean SSIM (MSSIM) is calculated by averaging all pixel values to assess overall image quality, with values ranging from 0 to 1, where higher values indicate greater similarity. However, MSSIM cannot directly interpret hue similarity because the luminance component l is influenced by the contrast c and structure s terms. To mitigate this, a monochrome similarity term G is introduced. G ( I , I h ) = 1 M i = 1 M g ( I ) g ( I h ) 2 measures tone preservation, with a valid range of [ 0 , 1 ] , by calculating the mean standard error between the Gaussian-blurred grayscale input g ( I ) and the Gaussian-blurred halftone image ( I h ) .

3.2. Pixel Expansion Elimination

In the original 2 × 2 -VCS, each secret pixel is encrypted into four sub-pixels, so the width and height of the decoded image are twice those of the secret image. This means that the carriers to conceal secret information are frequently four times larger than the information itself. Pixel expansion means that the size of the secret image cannot be too large; otherwise, it is difficult to align and superimpose the printed shares. The restored image cannot be used in the recognition system. To address this, we propose a non-extended VCS that utilizes downsampling preprocessing. This method reduces the size of the cost-secret image through downsampling, compensating for the expansion issue of the decrypted image that arises when each secret pixel is encrypted into four sub-pixels.
Downsampling filtering can reduce the resolution or size of images. It achieves this by removing certain pixels from the image, thereby decreasing the amount of information contained in it. Downsampling filtering typically consists of two steps: filtering and sampling. As shown in Equation (9), before downsampling, it is necessary to filter the image to remove high-frequency noise and details. These filters can be implemented by averaging, weighted averaging, or calculating the median of pixel values in local regions of the image. After filtering, the image is sampled by selecting specific pixels from the filtered image. The sampling method can be as simple as selecting one pixel every few pixels, or it can follow certain rules. Common sampling methods include nearest-neighbor sampling, bilinear interpolation, and bicubic interpolation. Nearest interpolation finds the nearest point from the original image matrix and then compares the pixel value of the nearest point. This will produce an obvious sawtooth. As shown in Equation (9), bilinear interpolation no longer directly considers the nearest point, but four points V 1 4 close to it, and then it distributes the weight through the proportion of the area.
f ( x , y ) = f V 1 x 2 x 1 y 2 y 1 x 2 x y 2 y + f V 2 x 2 x 1 y 2 y 1 x x 1 y 2 y + f V 3 x 2 x 1 y 2 y 1 x 2 x y y 1 + f V 4 x 2 x 1 y 2 y 1 x x 1 y y 1
where f ( x , y ) denotes the current pixel. x 2 x y 2 y denotes the total area. Note that we first downsample the image I with the size of W , H to W / 2 , H / 2 by the bilinear interpolation algorithm, and then reuse the existing basic encryption matrix of VCS to encrypt the image. Because one pixel is encrypted into four pixels, the decrypted image size is W / 2 × 2 = W , H / 2 × 2 = H , and the decrypted image and the secret image size are the same.
The circular nature of the Gaussian kernel allows it to better preserve edge information in multiple directions compared to other uniform blur filters. This is evident in convolution operations, where the Sobel operator can only extract vertical or horizontal edges [19]. The Gaussian kernel provides effective smoothing. Common applications include image blurring and downsampling, where low-pass filtering is essential beforehand to prevent false high-frequency information in the sampled image.
The flowchart in Algorithm 1 illustrates an integrated VCS for efficient and secure image sharing. The process begins with a secret image I of size W × H and weighting factors w t and w g . The first step involves preprocessing, where the image is downsampled using bilinear interpolation and transformed into a halftone image I h through iterative error diffusion and optimization of the objective function. Next, encryption matrices C 0 and C 1 are generated for white and black pixels based on predefined basis matrices. Finally, the halftone image I h is encrypted pixel-by-pixel using these matrices to produce the encrypted image I e . This method ensures both security and efficiency in image sharing.
Algorithm 1: The integrated visual cryptography for efficient and secure image sharing.
Applsci 15 04150 i001

4. Experimental Results

In this section, to evaluate the effectiveness of our method in enhancing privacy, we conduct comprehensive experiments by comparing our with other VCSs.

4.1. Experiment Setup

Our experiments are conducted on an Intel NUC machine equipped with an Intel Core i7 CPU and 4GB of RAM (Random Access Memory). The experimental code was primarily written in Python, a widely used high-level programming language favored by researchers for its simplicity and robust library support. In the experiments, we utilized the OpenCV library for image processing, as well as the NumPy and SciPy libraries for numerical computations. These libraries provided the necessary tools and functions for image encryption and performance evaluation.
We first explore and compare the encryption effects of different VC algorithms, particularly for grayscale and classic image encryption. As shown in Figure 2, we evaluate the performance of our algorithm, random-grid [20], probabilistic [7], and ED algorithms [21] through a series of stacking experiments. Each algorithm is adjusted for grayscale levels g = 1 8 , 2 8 , 4 8 , 6 8 , 7 8 . The random-grid encryption employs a random-grid method for encryption and generates a more uniform encryption pattern but may lack precision in details. The probability-based encryption takes into account more statistical features when generating encrypted images. We also include images of an airplane, baboon, Barbara, boat, pepper, butterfly, and houses for testing, as they are representative of image processing. Unlike some existing methods that have only demonstrated encryption effects on character images or simplistic patterns, we have taken a more holistic approach. Our qualitative experiments include a variety of classic images. This allows for a more thorough evaluation of our method’s performance and its applicability across different types of images.
In addition to the qualitative comparative experiments mentioned earlier, we also conducted quantitative comparative experiments. We take the peak signal-to-noise ratio (PSNR), SSIM, and Normalized Absolute Error (NAE) as perceptual metrics to evaluate the proposed method. PSNR is a measure of the similarity between the original image and the compressed or processed image. As shown in Equation (10), it calculates the mean square error and converts it into decibel units to represent the relative signal-to-noise ratio between the images. SSIM is a metric that measures the similarity between two images which is defined in Equation (8). Compared to PSNR, SSIM aligns more closely with human visual perception in evaluating image quality. We take the PSNR on blurred versions of grayscale and halftone images to evaluate tone preservation. PSNR is used for Gaussian blurred (kernel δ = 2 ) grayscale and halftone image pairs. NAE is a metric used to assess the quality of reconstructed images. SSIM evaluates the accuracy of a reconstructed image by comparing the pixel-level differences between the original and reconstructed images. NAE calculates the average absolute error between the two images and normalizes it by the total number of pixels in the original image. A lower NAE value indicates that the reconstructed image closely resembles the original image, indicating higher reconstruction quality. To simulate the image preprocessing steps, we first remap the gray levels of images to half and then obtain an ED image as a benchmark for comparison.
P S N R = 20 · log 10 M A X I M S E
N A E x , y = i , j x i , j y i , j i , j x i , j

4.2. Experiment Results

Across all tested grayscale levels, our algorithm consistently demonstrated better encryption results, with fewer clusters of pixels and a more uniform overall distribution, making it visually more appealing. This indicates that our algorithm optimizes the visual effect of the image while maintaining encryption security. Although the random-grid algorithm can produce uniform encryption patterns, it may not handle details as finely as our algorithm, especially at low grayscale levels, where the encrypted images might appear rather coarse. The probabilistic encryption method may exhibit certain statistical biases when dealing with grayscale levels, leading to uneven pixel distributions in certain areas of the encrypted image. Despite acceptable overall results, it falls slightly short of our algorithm in terms of detail retention and aesthetic appeal. Our algorithm excels in image encryption, ensuring both encryption security and superior visual effects compared to other comparative algorithms. Notably, our algorithm has significant advantages in reducing pixel clusters and enhancing the aesthetics of the images.
Figure 3 shows seven classic images for encryption. These are our, random-grid, probabilistic, block [16] and error diffusion-based VCSs from left to right, respectively. VCS has seen numerous advancements aimed at improving efficiency, security, and usability. Notable approaches include the random-grid VCS, which leverages random grids to create shares that individually reveal nothing about the secret image, and block-based VCS, which enhances flexibility and scalability by encrypting image blocks independently. Probabilistic VCS offers another solution, minimizing pixel expansion and improving decrypted image quality, making it ideal when pixel size is a concern. These techniques form the basis for our proposed method, which seeks to overcome existing VCS limitations and provide a more efficient and secure solution.
Our method demonstrated excellent encryption results across all test images. The encrypted images maintained the contours and feature information of the originals while creating difficult-to-recognize encrypted patterns through unique pixel distribution and density variations. This encryption method ensures both the security of the encryption and the preservation of the visual aesthetics of the images.
As shown in Table 1, our method demonstrates a level comparable to ED images in both PSNR and SSIM, indicating effective preservation of image details and structural information during the encryption process. The NAE value is also relatively low, significantly outperforming probabilistic and random-grid encryption methods. These results suggest that our encryption algorithm can effectively retain the visual features and structural information of images while protecting image data, providing an efficient and reliable solution in the field of image encryption.
Compared with the ED method, which optimizes image encryption through error diffusion technology but has high computational complexity and is not friendly to resource-constrained devices, our method significantly reduces computational overhead by combining downsampling and VCS, while maintaining high encryption quality. Unlike the probabilistic method that improves security by randomizing the encryption process but suffers from unstable decryption quality, our proposed method introduces weighting factors to ensure security while enhancing the stability of decryption quality. In contrast to the random-grid method that achieves encryption through grid partitioning but has severe pixel expansion issues, our method effectively reduces pixel expansion through downsampling technology, thereby optimizing the size and transmission efficiency of encrypted images.
The subtlety in performance differences can be attributed primarily to the nature of the preprocessing step involving halftoning algorithms in visual cryptography. Halftoning inherently reduces the quality of the image by converting continuous-tone images into binary representations. This process, while necessary for the VC encryption scheme, introduces a fundamental limit on the achievable image quality post-decryption.
In our experiments, despite the application of different encryption methods—ED, probabilistic, our method, and random-grid—the foundational halftoning step has already imparted a degree of image degradation. The subsequent VC encryption, which involves the overlay of black pixels, further darkens the decrypted image. Consequently, while our proposed method and other improvements aim to enhance image quality, the room for enhancement is inherently constrained by the preceding halftoning process.
Our quantitative experiments, which include metrics such as PSNR, SSIM, and NAE, are sensitive measures of image quality and similarity. The small differences in these metrics reflect the limited scope for improvement within the constraints imposed by the halftoning and VC encryption process. Even though our method and other advanced techniques have managed to incrementally improve upon the baseline, the improvements are moderate due to the aforementioned reasons.
For social networks, numerous devices need to acquire and transmit sensitive information while ensuring its confidentiality. Digital images rich in privacy information are vulnerable to interception, tampering, and theft when transmitted over public channels or networks. Ensuring the secure transmission, application, and storage of image privacy has become a challenging issue in building information security frameworks. However, these devices often have limited resources, making traditional image collection and protection strategies unsuitable. As a secret-sharing scheme for images, VC offers a lightweight security transmission solution that combines images and cryptography, with its threshold property ensuring that the encrypted image alone does not reveal any information about the original image. Although VCS eliminates complex computation processes and key dependencies, there are still issues like pixel expansion that need to be addressed to meet visual decryption requirements. The size correlation of secret information affects the carrier image size, leading to excessive resource consumption throughout the information protection process, and large carrier images are hard to obtain. To tackle this problem, we propose a no-expansion VC scheme based on downsampling preprocessing. This method reduces the cost of the encrypted image size through downsampling, addressing the image expansion issue caused by each secret pixel being encrypted into four sub-pixels. Experimental results demonstrate that our approach effectively eliminates the size expansion issue of VC while maintaining good image quality during decryption.

4.3. Security Analysis

Our proposed scheme ensures the confidentiality of images through an SS algorithm during the construction of shares. It is impossible to access the secret from shared images, as a single share or less than the threshold will not reveal any information about the secret image. This property is inherent to the VCS and has been formally proven by Naor and Shamir [11]. The preprocessing operations, such as downsampling and error diffusion, are performed on the cover images and do not involve the secret image. Therefore, the preprocessing step does not disclose any part of the secret image. The encryption process relies on the existing VCS mechanism, which has been proven to be secure. Even if an adversary intercepts the encrypted images, they cannot obtain the secret image without access to the required number of shares. Our method is computationally efficient, as it leverages the existing VCS mechanism and performs preprocessing operations only on the cover images. This makes our method suitable for real-time applications.

5. Conclusions

With the rapid development of big data and IoT, image sharing has become an important link on social networks. However, traditional data distribution methods often have difficulty meeting the requirements of real time, high efficiency, and security. Image encryption needs to balance privacy protection with data availability. While protecting user privacy, it is also necessary to maintain sufficient quality and availability of data. This strategy facilitates the secure distribution of access credentials among diverse nodes or devices, thereby enabling nuanced and adaptable access control measures while mitigating the susceptibility to compromises. Although conventional encryption methods serve to uphold data security, they encounter challenges associated with elevated computational complexity and diminished transmission efficiency. In this paper, we combine the VC and Siamese networks to securely transmit massive sensitive data in energy-sensitive devices. The color and gray spaces provide more room for quality improvement, and the Siamese network facilitates identification performance by comparing the similarity between the secret and lossy decrypted images.
In future work, we will explore adversarial defense based on VC, since halftoning and bit-reduction have been exploited for the detection of adversarial examples. We propose taking the halftone algorithm to bridge the adversarial robustness with the privacy protection of images. This approach not only enhances the model’s robustness against adversarial samples but also protects the privacy of the images. In high-computation environments such as cloud servers, we are exploring deep learning models like diffusion models to restore the original image from the decrypted image. Last but not least, social networks face challenges in managing and protecting sensitive content. The secret-sharing mechanism provides a way to divide sensitive content into multiple shares and distribute them to different nodes, thus improving security and adaptability.

Author Contributions

Conceptualization, D.Z.; methodology, software, validation, and data curation, L.R.;writing—original draft preparation, D.Z.; writing—review and editing and supervision, D.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This work is supported in part by the Key Research Platforms and Projects of Universities in Guangdong Province (Science and Technology) (XJ2023002702), and the Youth Program of Humanities and Social Sciences of the MoE (23YJCZH291).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The datasets generated during and/or analyzed during the current study are available from the corresponding author upon reasonable request.

Conflicts of Interest

The authors declare that they have no known competing financial interests or personal relationships that could appear to influence the work reported in this paper.

References

  1. Chen, J.; Wang, Y.; Yan, X.; Wang, J.; Li, L. Visual secret sharing scheme with (n,n) threshold based on WeChat Mini Program codes. J. Vis. Commun. Image Represent. 2022, 82, 103409. [Google Scholar] [CrossRef]
  2. Yang, Y.; Xiao, X.; Cai, X.; Zhang, W. A Secure and Privacy-Preserving Technique Based on Contrast-Enhancement Reversible Data Hiding and Plaintext Encryption for Medical Images. IEEE Signal Process. Lett. 2020, 27, 256–260. [Google Scholar] [CrossRef]
  3. Wen, W.; Fan, J.; Zhang, Y.; Fang, Y. APCAS: Autonomous Privacy Control and Authentication Sharing in Social Networks. IEEE Trans. Comput. Soc. Syst. 2022, 10, 3169–3180. [Google Scholar] [CrossRef]
  4. Wu, X.; Fang, J.; Yan, W. Contrast Optimization for Size Invariant Visual Cryptography Scheme. IEEE Trans. Image Process. 2023, 32, 2174–2189. [Google Scholar] [CrossRef] [PubMed]
  5. Gu, Z.; Li, H.; Khan, S.; Deng, L.; Du, X.; Guizani, M.; Tian, Z. IEPSBP: A Cost-Efficient Image Encryption Algorithm Based on Parallel Chaotic System for Green IoT. IEEE Trans. Green Commun. Netw. 2022, 6, 89–106. [Google Scholar] [CrossRef]
  6. Khan, R.; Kumar, P.; Jayakody, D.N.K.; Liyanage, M. A Survey on Security and Privacy of 5G Technologies: Potential Solutions, Recent Advancements, and Future Directions. IEEE Commun. Surv. Tutorials 2020, 22, 196–248. [Google Scholar] [CrossRef]
  7. Wu, X.; Yang, C.N. Probabilistic color visual cryptography schemes for black and white secret images. J. Vis. Commun. Image Represent. 2020, 70, 102793. [Google Scholar] [CrossRef]
  8. Ren, L.; Zhang, D. A QR code-based user-friendly visual cryptography scheme. Sci. Rep. 2022, 12, 7667. [Google Scholar] [CrossRef] [PubMed]
  9. Yan, B.; Xiang, Y.; Hua, G. Improving the Visual Quality of Size-Invariant Visual Cryptography for Grayscale Images: An Analysis-by-Synthesis (AbS) Approach. IEEE Trans. Image Process. 2019, 28, 896–911. [Google Scholar] [CrossRef] [PubMed]
  10. Zhang, D.; Shafiq, M.; Srivastava, G.; Gadekallu, T.R.; Wang, L.; Gu, Z. STBCIoT: Securing the Transmission of Biometric Images in Customer IoT. IEEE Internet Things J. 2024, 11, 16279–16288. [Google Scholar] [CrossRef]
  11. Naor, M.; Shamir, A. Visual cryptography. In Advances in Cryptology—EUROCRYPT’94; De Santis, A., Ed.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 1995; Volume 950, pp. 1–12. [Google Scholar] [CrossRef]
  12. Said, G.; Ghani, A.; Ullah, A.; Azeem, M.; Bilal, M.; Kwak, K.S. Light-Weight Secure Aggregated Data Sharing in IoT-Enabled Wireless Sensor Networks. IEEE Access 2022, 10, 33571–33585. [Google Scholar] [CrossRef]
  13. Talebi, H.; Milanfar, P. Learning to Resize Images for Computer Vision Tasks. In Proceedings of the 2021 IEEE/CVF International Conference on Computer Vision (ICCV), Los Alamitos, CA, USA, 10–17 October 2021; pp. 487–496. [Google Scholar] [CrossRef]
  14. Melkemi, M.; Hammoudi, K. Voronoi-based image representation applied to binary visual cryptography. Signal Process. Image Commun. 2020, 87, 115913. [Google Scholar] [CrossRef]
  15. Denghui, Z.; Hongbin, Z.; Shenglong, L.; Xu, W. HP-VCS: A high-quality and printer-friendly visual cryptography scheme. J. Vis. Commun. Image Represent. 2021, 78, 103–186. [Google Scholar] [CrossRef]
  16. Wu, X.; Luo, Z. Block-based progressive visual cryptography scheme with uniform progressive recovery and consistent background. J. Vis. Commun. Image Represent. 2022, 88, 103631. [Google Scholar] [CrossRef]
  17. Zhang, D.; Ren, L.; Shafiq, M.; Gu, Z. A Lightweight Privacy-Preserving System for the Security of Remote Sensing Images on IoT. Remote Sens. 2022, 14, 6371. [Google Scholar] [CrossRef]
  18. Ostromoukhov, V. A simple and efficient error-diffusion algorithm. In Proceedings of the SIGGRAPH ’01: 28th Annual Conference on Computer Graphics and Interactive Techniques, Los Angeles, CA, USA, 12–17 August 2001; Association for Computing Machinery: New York, NY, USA, 2001; pp. 567–572. [Google Scholar] [CrossRef]
  19. Son, C.H. Inverse halftoning through structure-aware deep convolutional neural networks. Signal Process. 2020, 173, 107591. [Google Scholar] [CrossRef]
  20. Wu, X.; Wong, D.S.; Li, Q. Threshold Visual Cryptography Scheme for Color Images with No Pixel Expansion. In Proceedings of the Second Symposium International Computer Science and Computation Technology, Huangshan, China, 26–28 December 2009. [Google Scholar]
  21. Zhou, Z.; Arce, G.R.; Di Crescenzo, G. Halftone visual cryptography. IEEE Trans. Image Process. 2006, 15, 2441–2453. [Google Scholar] [CrossRef] [PubMed]
Figure 1. The encryption and decryption of the pixel in visual cryptography.
Figure 1. The encryption and decryption of the pixel in visual cryptography.
Applsci 15 04150 g001
Figure 2. Stacking results for kinds of VCSs. Each column corresponds to one algorithm and each row corresponds to one gray level. From left to right are our algorithm, random-grid, probabilistic, and error diffusion-based VCSs. From bottom to top are gray levels g = 1 8 , 2 8 , 4 8 , 6 8 , 7 8 .
Figure 2. Stacking results for kinds of VCSs. Each column corresponds to one algorithm and each row corresponds to one gray level. From left to right are our algorithm, random-grid, probabilistic, and error diffusion-based VCSs. From bottom to top are gray levels g = 1 8 , 2 8 , 4 8 , 6 8 , 7 8 .
Applsci 15 04150 g002
Figure 3. Stacking results for kinds of VCSs. Each column corresponds to one algorithm and each row corresponds to one classic image. From left to right are our, random-grid, probabilistic, block, and error diffusion-based VCSs. From bottom to top are test images including airplane, baboon, Barbara, boats, peppers, butterfly, and house.
Figure 3. Stacking results for kinds of VCSs. Each column corresponds to one algorithm and each row corresponds to one classic image. From left to right are our, random-grid, probabilistic, block, and error diffusion-based VCSs. From bottom to top are test images including airplane, baboon, Barbara, boats, peppers, butterfly, and house.
Applsci 15 04150 g003
Table 1. Comparing four stacking VC algorithms on the seven classic images including ED, probabilistic, our method, and random-grid.
Table 1. Comparing four stacking VC algorithms on the seven classic images including ED, probabilistic, our method, and random-grid.
Test Images ↓Metrics →PSNRSSIMNAE
BaboonED20.520.830.36
probabilistic13.060.470.58
Our19.690.690.39
random-grid10.670.560.64
BarbaraED21.410.830.36
probabilistic12.790.440.62
Our20.540.720.40
random-grid11.240.520.65
BoatsED20.250.820.36
probabilistic13.090.450.58
Our19.280.70.39
random-grid10.910.560.63
ButterflyED20.830.830.36
probabilistic12.930.480.6
Our19.990.740.39
random-grid12.150.60.61
PeppersED20.680.830.36
probabilistic12.960.440.6
Our20.000.720.39
random-grid11.510.550.63
HouseED19.720.830.36
probabilistic13.080.480.56
Our18.870.680.39
random-grid10.830.580.62
AirplaneED17.820.810.36
probabilistic13.620.530.48
Our17.240.650.38
random-grid11.920.690.52
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Ren, L.; Zhang, D. Integrating Visual Cryptography for Efficient and Secure Image Sharing on Social Networks. Appl. Sci. 2025, 15, 4150. https://doi.org/10.3390/app15084150

AMA Style

Ren L, Zhang D. Integrating Visual Cryptography for Efficient and Secure Image Sharing on Social Networks. Applied Sciences. 2025; 15(8):4150. https://doi.org/10.3390/app15084150

Chicago/Turabian Style

Ren, Lijing, and Denghui Zhang. 2025. "Integrating Visual Cryptography for Efficient and Secure Image Sharing on Social Networks" Applied Sciences 15, no. 8: 4150. https://doi.org/10.3390/app15084150

APA Style

Ren, L., & Zhang, D. (2025). Integrating Visual Cryptography for Efficient and Secure Image Sharing on Social Networks. Applied Sciences, 15(8), 4150. https://doi.org/10.3390/app15084150

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop