# Integration of a Quantum Voting Scheme into Grayscale Images Using the Novel Enhanced Quantum Representation and Qiskit Framework

Authors: Alexandru-Gabriel Tudorache; Vasile Manta; Simona Caraiman
Journal: Modelling and Simulation in Engineering
 (2022)

---

## Abstract

This paper illustrates the way a proposed quantum voting scheme can be designed in combination with a steganography technique called Least Significant Bit (LSB), by modifying a small number of pixels in multiple grayscale images. It combines the voting scheme with the novel enhanced quantum representation (NEQR) of an image, where the LSBs of these pixels represent the vote for each entity that takes part in the voting process. A server is also used, not only to count but also to guarantee the integrity of the votes (which is done inherently, by its design and quantum properties). The superdense coding circuit is part of the design, allowing each voter to use one qubit in order to transmit two classical bits (the vote value). The selected platform for testing this scheme is IBM Quantum Experience, together with the open-source framework called Qiskit (written in Python). This framework allows users to create various quantum circuits, using a wide selection of quantum gates, and then to simulate them, either on a simulator or on a real quantum device. The quantum circuits and the measurement results are also presented in this paper.


---

## Body

## 1. Introduction

Secure voting using electronic systems has always been seen as an important problem by researchers, with multiple schemes proposed over the years. Numerous voting campaigns across the world, where multiple actors are involved with often conflicting interests, have always raised the issue of creating secure environments that guarantee various properties of the votes (correctness, integrity, and anonymity). Quantum computing, with its well-known properties such as entanglement and superposition, can be used to create certain connections between qubits that represent the votes (hidden in images and configurable by the voters) and qubits belonging to the server, therefore coming in aid of this dilemma. To be more precise, quantum computing allows us to entangle a qubit (or more) from the voting entity with one (or more) qubits from the server.This article’s innovative nature is the idea of bridging the gap between the fields of quantum voting schemes and steganography, as well as quantum image representations. It combines the quantum properties with the superdense coding circuit to show how qubits can be used to design a voting scheme that can be implemented on real systems, as well as simulators, also presenting another use for one of the most popular quantum algorithms. The main advantage of the scheme presented in this paper is that it uses one of the already proposed quantum image representation techniques; the algorithm extends the circuit designed for the novel enhanced quantum representation to the field of steganography, thus presenting a potential application in the area of secure information transmission.Some of the most important properties of quantum voting systems as well as various ideas that can be used in designing these systems are presented in paper [1]. The critical conditions required by a voting scheme are verifiability, security (one valid vote per person), and privacy. Among the security requirements, we mention the nonreusability (1 voter–1 vote), fairness/correctness (no data regarding the votes of others can be leaked before the vote ends), and eligibility. The voting systems can be grouped into two categories: the first implies that each voter has a separate container (ballot) for the vote, which must be sent to the server/master after the voter expresses his opinion (this idea can be referred to as DB (distributed ballot)); in the second one, the same container must reach all voters (TB (travelling ballot)). The concept of privacy, used in the field of quantum voting, is tied to the nature of the ballots, which, if handled in a secret manner, can lead to an architecture called anonymous voting. The scenarios for two voters and a generalized number of voters are analyzed, for both the TB and the DB concepts—the authors prove that the privacy is indeed protected. In the case of TB, entangled quantum states are selected to act as the ballot (set up by a master entity, referred to as authority). The entire demonstration for each discussed property can be consulted in paper [1].This article is structured as follows: the second section presents some of the most important articles in the fields of quantum voting schemes and quantum steganography. The third section presents the proposed quantum image representations techniques, the key aspects of the quantum framework used to implement the operations (IBM Quantum Experience and Qiskit) and the proposed algorithm design. The fourth section presents the implementation details of this protocol for a sample grayscale image and the obtained results, after configuring and simulating the desired circuits. The last two sections describe some ideas to continue the research and point out the main contributions.


## 2. Related Work

Multiple ideas have been proposed in research papers from the quantum topic, and some of them are presented here, serving as inspiration for the current work. The articles have been grouped in two classes: those that approach the voting systems, using the quantum properties and proposing quantum circuits for this purpose, and articles that contain ideas for hiding data in images (quantum steganography).


### 2.1. Quantum Voting Systems

In article [2], the authors present a voting system where the ballot is in an unknown state. The state of the ballot cannot be easily modified, as the no-cloning theorem ensures the fact that no quantum state can be cloned. Anonymity is guaranteed, as the voters cannot choose a random value for the ballot (and then proceed with the algorithm). One important part of the presented algorithm, the encoding of the vote, is dependent on the ballot: since it is in a random state, each voter has to apply his quantum gates according not only to his vote value but also to the ballot’s state. A cut-and-choose protocol is described, where if certain pieces of the vote are found to be invalid, the voting process is cancelled. Figures 1, 2 and 3 from paper [2] illustrate the state of the quantum ballot: blank, randomized blank, and a filled voting ballot, encoding a certain message, thus offering a better understanding of the protocol. The authors of article [2] believe that quantum schemes such as the one described will soon be able to break a large part of the actual cryptographic algorithms.A voting scheme based on a multiparticle entangled state is presented in paper [3], where the security of the proposed system is analyzed. This scheme consists of voters, an administrator, who counts the votes, and a scrutinizer. The voting scheme is described for the participation of 3 voters (one of each type), one of whom (the scrutinizer) creates a number of qubit pairs in the Greenberger-Horne-Zeilinger (GHZ) maximally entangled state, which can be written as follows:
(1)ψ=12000000±111111.The administrator receives the first particle, while the voter receives particles 2 and 3. According to a convention table that specifies the connection between the value of the vote and certain quantum gates, the voters perform multiple operations, which result in a different state configuration (the obtained quantum states are still entangled). The secret key is represented by a function chosen by the voter from the table. The paper also presents a detection process, ran by the administrator, that is part of the voting scheme (an example is given in Table 2 of article [3], which shows Alice’s and Bob’s quantum states in the detection process); an analysis for a man-in-the middle attack is also described, demonstrating the security of the protocol in this scenario. An extension idea is suggested for this scheme, based on quantum key distribution, and the above concepts can be further developed by carrying out various types of analysis for different attacks, involving parties that work together to sabotage the vote or try to interfere by performing illegal voting operations.Paper [4] presents different ideas for quantum voting, based on entangled states, which by design ensure the anonymity of the votes; the proposed quantum protocol achieves a complexity reduction of order N, where N represents the number of voters. The paper describes a method called comparative ballot, where each vote represents the expression of a binary option; it illustrates a protocol for anonymous survey and a particular case of this survey, called anonymous binary-valued ballot—this extends the idea of a binary vote to a list of questions, each requiring a binary answer from the voters. The authors discovered an inverse relation between the privacy of the vote and the number of options for each voter, as a general property for systems of this kind. Two-valued and multivalued ballots are presented in paper [5], where a special operation is described, with the purpose of stopping multiple votes from the same voter, as well as forbidding the cast of negative votes (thus stopping malicious voters from cheating). The protocol uses entangled states of continuous variables and also relies on the honesty of the tallyman, as the authors recommend that the operations performed by this entity should be done in a transparent (public) manner. Figure 3 from paper [5] also shows the experimental setup, for the representation and interaction with the voting ballot, using different modulators, a beam splitter, and an optical parametric oscillator.


### 2.2. Quantum Steganography

Steganography is the subfield of information processing that specializes in hiding various types of information inside messages or files; quantum steganography uses the special properties of the quantum universe, such as superposition and entanglement in achieving this purpose. Multiple ideas have been introduced in the recent years in this research area, some of which are highlighted below.The authors of paper [6] describe a new watermarking protocol, combining the NEQR representation of an image (see paper [7]), the Gray code transform, and the LSB technique. A similar idea that also integrates the Arnold scrambling is illustrated in article [8], which yields a lower time complexity. Two keys are used in embedding and recovering the secret message in paper [9], where the bit-plane scrambling technique is also added, as a preliminary operation on the original image, before applying the Arnold transform. The exploiting modification direction (EMD) algorithm is the base concept on which the authors of article [10] build on, using color images and generating the key by using two of the (R, G, B) color channels. In paper [11], in addition to EMD, the authors hide the message using the bit-plane technique, and together with dynamically sharing between subgroups, they obtain a better embedding rate. The inverted pattern method can also be used (see paper [12]), where the state of the quantum key determines if the pixel from the message should be inverted. The key is saved in the LSBs of a parameterized number of pixels. A method of detection is presented in article [13], where the authors combine the NEQR representation with the LSB technique. The idea is to split the pixels into multiple blocks, which are then classified in 3 groups; evaluating each group reveals the potential presence of a hidden information. Multiple metrics that indicate the correct transmission are explained in paper [14], such as geometric coherence and ½-affinity coherence, evaluated for a version of the BB84 quantum protocol. The application of LSBq for multiwavelength quantum images in steganography is described in article [15], where the authors suggest using the modulo method and the Hilbert scrambling technique to embed the message. For recent developments and various techniques in the field of steganography, we also refer the reader to papers [16–33].


## 2.1. Quantum Voting Systems

In article [2], the authors present a voting system where the ballot is in an unknown state. The state of the ballot cannot be easily modified, as the no-cloning theorem ensures the fact that no quantum state can be cloned. Anonymity is guaranteed, as the voters cannot choose a random value for the ballot (and then proceed with the algorithm). One important part of the presented algorithm, the encoding of the vote, is dependent on the ballot: since it is in a random state, each voter has to apply his quantum gates according not only to his vote value but also to the ballot’s state. A cut-and-choose protocol is described, where if certain pieces of the vote are found to be invalid, the voting process is cancelled. Figures 1, 2 and 3 from paper [2] illustrate the state of the quantum ballot: blank, randomized blank, and a filled voting ballot, encoding a certain message, thus offering a better understanding of the protocol. The authors of article [2] believe that quantum schemes such as the one described will soon be able to break a large part of the actual cryptographic algorithms.A voting scheme based on a multiparticle entangled state is presented in paper [3], where the security of the proposed system is analyzed. This scheme consists of voters, an administrator, who counts the votes, and a scrutinizer. The voting scheme is described for the participation of 3 voters (one of each type), one of whom (the scrutinizer) creates a number of qubit pairs in the Greenberger-Horne-Zeilinger (GHZ) maximally entangled state, which can be written as follows:
(1)ψ=12000000±111111.The administrator receives the first particle, while the voter receives particles 2 and 3. According to a convention table that specifies the connection between the value of the vote and certain quantum gates, the voters perform multiple operations, which result in a different state configuration (the obtained quantum states are still entangled). The secret key is represented by a function chosen by the voter from the table. The paper also presents a detection process, ran by the administrator, that is part of the voting scheme (an example is given in Table 2 of article [3], which shows Alice’s and Bob’s quantum states in the detection process); an analysis for a man-in-the middle attack is also described, demonstrating the security of the protocol in this scenario. An extension idea is suggested for this scheme, based on quantum key distribution, and the above concepts can be further developed by carrying out various types of analysis for different attacks, involving parties that work together to sabotage the vote or try to interfere by performing illegal voting operations.Paper [4] presents different ideas for quantum voting, based on entangled states, which by design ensure the anonymity of the votes; the proposed quantum protocol achieves a complexity reduction of order N, where N represents the number of voters. The paper describes a method called comparative ballot, where each vote represents the expression of a binary option; it illustrates a protocol for anonymous survey and a particular case of this survey, called anonymous binary-valued ballot—this extends the idea of a binary vote to a list of questions, each requiring a binary answer from the voters. The authors discovered an inverse relation between the privacy of the vote and the number of options for each voter, as a general property for systems of this kind. Two-valued and multivalued ballots are presented in paper [5], where a special operation is described, with the purpose of stopping multiple votes from the same voter, as well as forbidding the cast of negative votes (thus stopping malicious voters from cheating). The protocol uses entangled states of continuous variables and also relies on the honesty of the tallyman, as the authors recommend that the operations performed by this entity should be done in a transparent (public) manner. Figure 3 from paper [5] also shows the experimental setup, for the representation and interaction with the voting ballot, using different modulators, a beam splitter, and an optical parametric oscillator.


## 2.2. Quantum Steganography

Steganography is the subfield of information processing that specializes in hiding various types of information inside messages or files; quantum steganography uses the special properties of the quantum universe, such as superposition and entanglement in achieving this purpose. Multiple ideas have been introduced in the recent years in this research area, some of which are highlighted below.The authors of paper [6] describe a new watermarking protocol, combining the NEQR representation of an image (see paper [7]), the Gray code transform, and the LSB technique. A similar idea that also integrates the Arnold scrambling is illustrated in article [8], which yields a lower time complexity. Two keys are used in embedding and recovering the secret message in paper [9], where the bit-plane scrambling technique is also added, as a preliminary operation on the original image, before applying the Arnold transform. The exploiting modification direction (EMD) algorithm is the base concept on which the authors of article [10] build on, using color images and generating the key by using two of the (R, G, B) color channels. In paper [11], in addition to EMD, the authors hide the message using the bit-plane technique, and together with dynamically sharing between subgroups, they obtain a better embedding rate. The inverted pattern method can also be used (see paper [12]), where the state of the quantum key determines if the pixel from the message should be inverted. The key is saved in the LSBs of a parameterized number of pixels. A method of detection is presented in article [13], where the authors combine the NEQR representation with the LSB technique. The idea is to split the pixels into multiple blocks, which are then classified in 3 groups; evaluating each group reveals the potential presence of a hidden information. Multiple metrics that indicate the correct transmission are explained in paper [14], such as geometric coherence and ½-affinity coherence, evaluated for a version of the BB84 quantum protocol. The application of LSBq for multiwavelength quantum images in steganography is described in article [15], where the authors suggest using the modulo method and the Hilbert scrambling technique to embed the message. For recent developments and various techniques in the field of steganography, we also refer the reader to papers [16–33].


## 3. Materials and Methods

### 3.1. Image Representation Techniques

There have been a considerate number of proposals regarding quantum image representations, each with its advantages and restrictions. Among the most important ones we mention the flexible representation of quantum images (FRQI, introduced in paper [34]), where the quantum state of the system is written as a combination of pixel color and position, taking into account the angle vector for the color component. In the novel enhanced quantum representation (NEQR, presented in [7], used for grayscale images), the information about the pixels’ color is stored in the multiqubit computational basis of the superposition state. Novel quantum representation of color digital images (NCQI, see [35]) is the generalized version of NEQR, applied to color images (based on the RGB color model). Another idea to process images is the new quantum representation model of color digital images (QRCI, proposed in paper [36]), which allows researchers to define the quantum state of the image using bit-planes.For the implementation part of this paper, we chose the NEQR representation, allowing us to have good control of the color information; we also have the ability to recover the original image in a finite number of quantum measurements.


### 3.2. IBM’s Quantum Framework

The framework and computing platform used to test the proposed solution is IBM Quantum Experience [37], along with Qiskit, IBM’s open-source framework, written in Python. IBM Quantum Experience is an online platform that allows users to design and simulate quantum circuits, by offering a wide selection of quantum gates to be added from a visual interface. Qiskit is intended for programmers who want to write their code and make their circuits more adaptable (or parameterized) for each algorithm they choose to test. In both scenarios, the researchers can opt to simulate the circuit on the local machine (limited in terms of qubits by the memory of the device) or on a real quantum device, accessible in the cloud; at this time, there are real machines that use 1, 5, and 15 qubits, available to the general public. If the real device is selected, the circuit is added to the execution queue for that respective device, and after the experiment is run, the results are available for analysis. There are four main parts in Qiskit, each with its own purpose—Qiskit Terra, Aer, Aqua, and Ignis. Terra is the name for the collection of tools used at the circuit level; Aer is the simulator part of Qiskit; Aqua can be seen as a library of algorithms, and Ignis helps researchers analyze the impact of noise in quantum systems. Figure 1 shows the mentioned parts of the Qiskit framework.Figure 1
The Qiskit framework and its modules.


### 3.3. Algorithm Design

This paper proposes the following ideas for a quantum voting system. We assume that multiple entities want to take part in a voting process, where each voter can choose only one option from a maximum of 4 options (to which we have associated the values 0, 1, 2, and 3—we refer to this as the vote value). The proposed system is made up of a master entity, the server, responsible for the integrity and correctness of the votes; it shares 1 pair of qubits with each of the voters required for the vote value (one for the server and one for the voter), as well as one more qubit, shared between the server and each voter, that is set to state1, after he has expressed his opinion. This qubit is set by each voter, using 2 additional qubits, both belonging to the voter. For example, if we take into consideration 3 voters (Alice, Bob, and Charlie), this means that the server has 3 qubits, each of them entangled with each voter’s value qubit, and 3 more, to which we refer to as validation qubits, that are shared by the sever and each voter; they are initially set in the 0 state, and each voter then sets his corresponding validation qubit to 1, after he has set his value qubit (so 6 qubits in total for the server).The server selects and sends the same grayscale image to each voter; before sending the image, the server resets (to 0) the LSBs of the voting pixels. In case a person decides not to vote, he simply does not set to1 the vote validation qubit, which is equivalent to leaving it unmodified, to its initial state, 0. The voting pixels can be randomly chosen from the edges of the image or specifically selected from a certain region. For the ease of explaining and implementing the described algorithm, this paper analyzes the scenario where the voting pixels are chosen in the opposite corners of the image, namely, the upper-left and lower-right corners. After each voter receives the image, he modifies the LSB of the voting pixels and then represents them in their NEQR form. The value of the vote is encoded in the LSBs using the following convention:
(2)votevalue=LSBpixel00LSBpixeln−1m−12,as binary notation, for an image of n∗m pixels. In decimal, this is equivalent to
(3)votevalue=2∗LSBpixel00+LSBpixeln−1m−110.The qubits for the LSBs are then used to set the state of the shared validation qubit to1, when their state corresponds to the desired vote value (a Toffoli gate is used). Each voter also entangles his value qubit with a qubit on the server, respecting the quantum superdense coding circuit: he applies a certain gate depending on the value that he wants to send. Only one qubit from the voter is necessary to transmit 2 classical bits of information to the server. Table 1 shows the available options and the gates applied.Table 1
Applied gate in correspondence with the vote value, used in the superdense coding circuit, where one qubit belongs to the voter and the other one to the server.
Vote value (binary)Applied quantum gate00I01X10Z11ZXOnce the voting window ends, the server analyzes the qubits for each voter, by first measuring the validation qubit, to make sure that the voter has expressed his vote and then by measuring the state of the corresponding value qubit for that voter, thus finding out his option. If the state of the validation qubit is0 for a voter, then that particular vote is simply not counted. The server can then use the classical information processing tools to save and count all the votes. The entire voting system is schematically presented in Figure 2.Figure 2
The proposed voting scheme. (a) Step 1: the voters first receive a grayscale image from the server. (b) Step 2: the voters create the NEQR representation of the pixels in the corners of the image. For each voter, the qubits representing the LSB denote the operation gate that needs to be applied to the voter’s value circuit (the superdense coding circuit) so that the server can retrieve the actual vote. (c) Step 3: once each voter finishes setting the value qubit, he can set the validation qubit to1; this indicates to the server that the voter expressed his option and can now add it, after the measurement, to the final count.
(a)(b)(c)


## 3.1. Image Representation Techniques

There have been a considerate number of proposals regarding quantum image representations, each with its advantages and restrictions. Among the most important ones we mention the flexible representation of quantum images (FRQI, introduced in paper [34]), where the quantum state of the system is written as a combination of pixel color and position, taking into account the angle vector for the color component. In the novel enhanced quantum representation (NEQR, presented in [7], used for grayscale images), the information about the pixels’ color is stored in the multiqubit computational basis of the superposition state. Novel quantum representation of color digital images (NCQI, see [35]) is the generalized version of NEQR, applied to color images (based on the RGB color model). Another idea to process images is the new quantum representation model of color digital images (QRCI, proposed in paper [36]), which allows researchers to define the quantum state of the image using bit-planes.For the implementation part of this paper, we chose the NEQR representation, allowing us to have good control of the color information; we also have the ability to recover the original image in a finite number of quantum measurements.


## 3.2. IBM’s Quantum Framework

The framework and computing platform used to test the proposed solution is IBM Quantum Experience [37], along with Qiskit, IBM’s open-source framework, written in Python. IBM Quantum Experience is an online platform that allows users to design and simulate quantum circuits, by offering a wide selection of quantum gates to be added from a visual interface. Qiskit is intended for programmers who want to write their code and make their circuits more adaptable (or parameterized) for each algorithm they choose to test. In both scenarios, the researchers can opt to simulate the circuit on the local machine (limited in terms of qubits by the memory of the device) or on a real quantum device, accessible in the cloud; at this time, there are real machines that use 1, 5, and 15 qubits, available to the general public. If the real device is selected, the circuit is added to the execution queue for that respective device, and after the experiment is run, the results are available for analysis. There are four main parts in Qiskit, each with its own purpose—Qiskit Terra, Aer, Aqua, and Ignis. Terra is the name for the collection of tools used at the circuit level; Aer is the simulator part of Qiskit; Aqua can be seen as a library of algorithms, and Ignis helps researchers analyze the impact of noise in quantum systems. Figure 1 shows the mentioned parts of the Qiskit framework.Figure 1
The Qiskit framework and its modules.


## 3.3. Algorithm Design

This paper proposes the following ideas for a quantum voting system. We assume that multiple entities want to take part in a voting process, where each voter can choose only one option from a maximum of 4 options (to which we have associated the values 0, 1, 2, and 3—we refer to this as the vote value). The proposed system is made up of a master entity, the server, responsible for the integrity and correctness of the votes; it shares 1 pair of qubits with each of the voters required for the vote value (one for the server and one for the voter), as well as one more qubit, shared between the server and each voter, that is set to state1, after he has expressed his opinion. This qubit is set by each voter, using 2 additional qubits, both belonging to the voter. For example, if we take into consideration 3 voters (Alice, Bob, and Charlie), this means that the server has 3 qubits, each of them entangled with each voter’s value qubit, and 3 more, to which we refer to as validation qubits, that are shared by the sever and each voter; they are initially set in the 0 state, and each voter then sets his corresponding validation qubit to 1, after he has set his value qubit (so 6 qubits in total for the server).The server selects and sends the same grayscale image to each voter; before sending the image, the server resets (to 0) the LSBs of the voting pixels. In case a person decides not to vote, he simply does not set to1 the vote validation qubit, which is equivalent to leaving it unmodified, to its initial state, 0. The voting pixels can be randomly chosen from the edges of the image or specifically selected from a certain region. For the ease of explaining and implementing the described algorithm, this paper analyzes the scenario where the voting pixels are chosen in the opposite corners of the image, namely, the upper-left and lower-right corners. After each voter receives the image, he modifies the LSB of the voting pixels and then represents them in their NEQR form. The value of the vote is encoded in the LSBs using the following convention:
(2)votevalue=LSBpixel00LSBpixeln−1m−12,as binary notation, for an image of n∗m pixels. In decimal, this is equivalent to
(3)votevalue=2∗LSBpixel00+LSBpixeln−1m−110.The qubits for the LSBs are then used to set the state of the shared validation qubit to1, when their state corresponds to the desired vote value (a Toffoli gate is used). Each voter also entangles his value qubit with a qubit on the server, respecting the quantum superdense coding circuit: he applies a certain gate depending on the value that he wants to send. Only one qubit from the voter is necessary to transmit 2 classical bits of information to the server. Table 1 shows the available options and the gates applied.Table 1
Applied gate in correspondence with the vote value, used in the superdense coding circuit, where one qubit belongs to the voter and the other one to the server.
Vote value (binary)Applied quantum gate00I01X10Z11ZXOnce the voting window ends, the server analyzes the qubits for each voter, by first measuring the validation qubit, to make sure that the voter has expressed his vote and then by measuring the state of the corresponding value qubit for that voter, thus finding out his option. If the state of the validation qubit is0 for a voter, then that particular vote is simply not counted. The server can then use the classical information processing tools to save and count all the votes. The entire voting system is schematically presented in Figure 2.Figure 2
The proposed voting scheme. (a) Step 1: the voters first receive a grayscale image from the server. (b) Step 2: the voters create the NEQR representation of the pixels in the corners of the image. For each voter, the qubits representing the LSB denote the operation gate that needs to be applied to the voter’s value circuit (the superdense coding circuit) so that the server can retrieve the actual vote. (c) Step 3: once each voter finishes setting the value qubit, he can set the validation qubit to1; this indicates to the server that the voter expressed his option and can now add it, after the measurement, to the final count.
(a)(b)(c)


## 4. Implementation Details and Results

This section illustrates how the described procedure can be implemented using IBM’s quantum framework, Qiskit, as well as the simulation results for the proposed circuits. The first part of the implementation focuses on the NEQR representation of an image (only the target pixels in our case) and on designing the circuit that allows the voter to set to1 the state of the validation qubit, available to the server. This qubit informs the server that the voter has configured his image according to the vote value so that the server knows that the voter actually expressed his opinion at the end of the time voting window. The second part presents the interpretation of the superdense coding circuit, used in our case to transmit the vote value using a single qubit for each voter.The server first selects a grayscale image (a pixel is represented in our case using 8 bits, in the interval 0–255) and sets its LSB to 0, for the two mentioned target pixels, as can be seen in Figure3 (the original image can be found at source [38]; this is a downscaled version, used for demonstration purposes).Figure 3
(a) The original8×6 grayscale image selected by the server and (b) its modified version—the LSBs of the upper-left and lower-right pixels are set to 0. The differences between the two are hardly noticeable.
(a)(b)We analyzed the case of 3 voters, Alice, Bob, and Charlie, each of them free to choose one option out of 4, represented by values 0, 1, 2, and 3 in decimal (00, 01, 10, and 11 in binary). The first bit in the binary representation of the vote value is embedded in the upper-left pixel’s LSB, while the second one is hidden in the lower-right pixel’s LSB. Once the grayscale image is received by the voters, they modify it, according to their votes, and then represent those important pixels in their NEQR form. Assuming that Alice and Charlie both vote with “2” (102) and Bob votes with “1” (012), their images are presented in Figure 4.Figure 4
(a) Alice’s (same as Charlie’s) and (b) Bob’s images, with their votes embedded in the upper-left and lower-right pixels’ LSB.
(a)(b)Alice changes the LSB of the upper-left pixel to “1” (so her first pixel has gray level 137 instead of 136), while leaving the lower-right pixel’s LSB set to “0” (keeping the gray value at 74). Similarly, Bob leaves the upper-left pixel in his image unmodified, at gray value 136, its LSB already being set to “0,” and changes the lower-right pixel’s LSB to “1” (the gray value becomes 75).Below, we illustrated the NEQR representation of Alice’s vote pixels, in Figure5 (for the upper-left pixel) and Figure 6 (for the lower-right pixel), along with the measurement results obtained on the local simulator, using 1024 shots (program runs). This implementation requires 8 qubits for the gray level, 6 qubits for the position component (qp5-qp3 for the columns, qp2-qp0 for the rows), and 5 auxiliary qubits; the last auxiliary one, anc4, is set to state 1 when all the position qubits match the state of the correct row and column. This means that 19 qubits are required in total for the NEQR representation. The circuit also contains 2 classical registers, cr_q, on 8 bits, and cr_a, on 1 bit, used to save the collapsed state, after measuring the gray level and the anc4 qubit, respectively.Figure 5
The NEQR representation of gray value 137 (the pixel in the upper-left corner of Alice’s image, where the last bit was set to “1,” changing the value from 136 to 137). The binary representation of 137 is100010012, where the first bit (to the left) represents the MSB, corresponding to q7, and the last one (to the right)—the LSB, corresponding to q0; the classical binary representation of the pixel gray value should be seen in relation to qubits q7q6q5q4q3q2q1q0. The LSB of the pixel is represented by qubit q0, and its state is set to 1 (the first bit from the binary representation of 102, Alice’s vote). The auxiliary qubit anc4 is set to state 1 only after the position qubits are in the desired state; here, for the first pixel, the desired states are all initially 0, since the target pixel is at coordinates (0, 0), so a round of NOT gates on all position qubits is required. The last three CNOT gates configure the states for the corresponding gray value qubits, q7, q3, and q0, thus ensuring the state matches level 137. The purpose of the final layer of NOT gates is to allow another potential NEQR representation of a new gray value for a different pixel after this one (they must be set to cancel the NOT gates in the beginning). On the right, in the histogram that illustrates the result of the quantum measurement, we can see that the gray level qubits are only set to their desired states when the anc4 qubit is in state 1.Figure 6
The NEQR representation of gray value 74 (the pixel in the lower-right corner of Alice’s image). The LSB is represented by qubitq0, and its state is set to 0 (the second bit from the binary representation of 102, Alice’s vote in binary). The voter needs to add a NOT gate in the validation circuit for this qubit (q0). In a similar manner to the representation in Figure 5, the q7q6q5q4q3q2q1q0 representation must match the binary value of 74, which is 001011112, when the position qubits are in the expected states. Here, the pixel’s coordinates are (5, 7)—values 1012 (qp2qp1qp0) and 1112 (qp5qp4qp3) in binary; therefore, only one NOT gate is needed for the position qubits before the connection between anc4 and the gray level qubits, more exactly for qp1.For the circuits in Figures5 and 6 (the NEQR representation), we can formally write the action of the qubits as follows (all qubits are initially in the 0 state):
(1)
The auxiliary qubits are deduced from the position qubits, using CCNOT gates:(4)anc0=anc0⊕qp0∧qp1,anc1=anc1⊕qp2∧qp3,anc2=anc2⊕qp4∧qp5,anc3=anc3⊕anc0∧anc1,anc4=anc4⊕anc2∧anc3.(2)
The gray value qubits (q7-q0) are set using CNOT gates where necessary, using the anc4 qubit; for value 137 in Figure 5, the state of qubits q1,q2,q4,q5, and q6 is left unchanged, while qubits q0, q3, and q7 are modified according to the following relations:(5)q0=q0⊕anc4,q3=q3⊕anc4,q7=q7⊕anc4.The two LSBs from the vote pixels are further used in another circuit, one that controls the server’s validation qubit for that voter. This is achieved by combining the mentioned circuits, adding a NOT gate for each LSB if required (the voter can add any number of gates he desires for his qubits), and then adding a Toffoli gate, as shown in Figure7. The final qubit, q_check, belongs to the server.Figure 7
The NEQR representation of the two pixels describing Alice’s vote:q-LSB0 (quantum register with 8 qubits) for the pixel in the upper-left corner (value 137) and q-LSB1 (quantum register with 8 qubits) for the pixel in the lower-right corner (value 74). Qubit q_check, which belongs to the server, is set to state 1 when the control qubits of the last Toffoli gate (after the second barrier) are both in state 1 (so the voter has to configure his part of the circuit according to his vote and add, if necessary, NOT gates for q-LSB00 and q-LSB10). In this particular situation, the voter added a NOT gate for q-LSB10. The representation for each gray value is explained in detail in Figures 5 and 6.In addition to the equations describing the position, auxiliary, and gray value qubits, which still apply to the NEQR representations in Figure7, we can also write equation (6) for q_check (its initial state in the circuit above is 0). Alice’s vote is 102, and these 2 bits correspond to q-LSB00 and q-LSB10; for this vote value, a NOT gate is required for the q-LSB10 qubit (the LSB of value 74 is 0):
(6)qcheck=qcheck⊕q−LSB00∧q−LSB10¯.The circuit presented in Figure7, containing 39 qubits, was simulated on the local machine, with an Intel i9-9900K processor at a base speed of 3.60 GHz, using approximately 16.56 GB of RAM, for 1024 shots, and the results are shown in Figure 8. The CPU ran at 100% at 4.68 GHz for the simulation time of 22.259 seconds; the Qiskit version used for this simulation was 0.25.2. For this circuit configuration, the probability of finding the q_check qubit in state 1 is close to the theoretical one (1/64=0.015625), as there is only one scenario where the qubits from both images are configured as desired.Figure 8
The simulation results for the circuit in Figure7, where the measured qubits are q-LSB10, q-LSB00, and q_check (bottom to top)—there is a 0.018 probability of q_check being in state 1 (also conditioned by the 1 state of the other two measured qubits). Here, q-LSB10 is always in state 1, since the NEQR representation of gray value 74 leaves the LSB qubit in state 0 with 100% probability, and adding a NOT gate inverts its state (without modifying the probability).The second part of the algorithm involves using the superdense coding circuit, which allows each voter to use a single qubit to send two bits of classical information (the voting value in binary) to the server. For Alice’s vote value,102, the circuit is presented in Figure 9.Figure 9
The superdense coding circuit, represented for Alice’s vote value of102. According to Table 1, the gate used to encode this value in a single qubit is the Z gate.By simulating the circuit in Figure9 and measuring the results, we obtain the expected result of 102 (1 for the cr_voter and 0 for cr_server) with probability 100% (Figure 10). The simulation took place on the same local machine described above (with the same configuration), and it required only 0.349 seconds (the RAM change is unnoticeable since we are only simulating 2 qubits).Figure 10
The measurement result for the circuit in Figure9. The outcome for the vote value is always 10 (the result 01 can be explained by taking into account the fact that in Qiskit, the measurement results are read bottom-top, in our case from the lower classical bit, cr_server, to the upper one, cr_voter).Once all voters have first set the state for their value qubit (by adding the corresponding gate for their vote value) and then set the state of their validation qubit to1, the voting system requires the server to wait for the dedicated time window to close. At the end of this time interval, the server first validates each vote by making sure that the state of the validation qubit is 1 and then obtains the vote value from the superdense coding circuit and counts it. The counting process can be done in a classical manner, after which the server can post the results on a public website (assuming it can be done so securely, otherwise a different system can be used to share the vote results). In the presented situation, the server would nominate candidate “2” as the election winner with 2 votes (from Alice and Charlie), while candidate “1” would have a single vote from Bob, and there would be no votes for the other 2 candidates.The simulation conditions, describing the machine used to create the above circuits (for Alice’s vote value circuit, in Figure7, and the superdense coding circuit, from Figure 9), together with the simulation results, can also be summarized in Table 2.Table 2
Main results for the presented simulations.
CircuitNumber of qubitsSimulation timeRAM memoryOperating systemProcessor speed (during simulation)Qiskit versionNumber of shots (program runs)Alice’s vote circuit (Figure7)3922.259 seconds16.56 GBWindows 104.68 GHz0.25.21024Superdense coding circuit (Figure9)20.349 secondsUnnoticeable for 2 qubits


## 5. Discussion

In this section of the paper, we present some of the ideas that can be developed in order to continue the research described above. These ideas are grouped as follows:(a)
The voting system can rely on different types of images (RGB images) to be shared by the server, as well as various types of quantum representations techniques for these images (FRQI, NCQI, and QRCI)(b)
A different algorithm can be used to embed the vote, while still maintaining a connection to the chosen image representation technique. This paper selects the LSB of certain pixels; another idea is to use the average value of the gray pixel intensity from dedicated regions of the image. The image alteration techniques can also be done not only in the time domain, but also in the frequency domain (using the quantum Fourier transform)(c)
The voting system can be extended to allow more candidates and more options for the voters. If more candidates decide to take part in the election, this requires designing an extension of the superdense coding circuit (more qubits are therefore needed for the server). The voters can also express their view using an option from the following group for each candidate (approve, reject, and abstain), which translates to a larger part of the image being used to express the vote (a certain region for each candidate)The potential implications of designing such a voting system, together with the mentioned alternatives and extension ideas, are far-reaching: by using different types of images, or even other types of data, the size of the information given by the users could be very well increased; its efficiency could also be improved, allowing for a better embedding system, being harder to notice by the human eye. The same can be said about using a different domain representation (such as the frequency one). Implementing the discussed algorithm (or close variations) on a future, but already existing, quantum infrastructure, would reduce the costs required for building secure, dedicated devices that would be used only for elections. The benefits would extend even further, not only from a financial point of view but also from a sociodemographic perspective—if a system such as this would be deployed, then all countries would have access to a more transparent and democratic voting system; this is crucial for assuring that the will of the people is not tampered with and can therefore help a civilization advance in the right direction and at a greater speed. Its usage could also be intertwined with the cryptographical area, perhaps helping in generating private and/or public keys for the already existing crypto-systems or be selected in the design of new quantum protocols. The scheme described in this article can be extended to other algorithms (new or existing), where the vote values can be interpreted as required by those protocols. Choosing to use color images adds a new layer of complexity, given by their quantum representations, but also a better integration with what the human eye is already accustomed to. Color images, by having more components in their representation (such as RGB), allow for more granular modifications; for example, integrating a larger number could be done by making small changes in each component, with a dedicated algorithm required for recovering it. The result of such an action would be an image that looks closer to the original one and much less prone to be analyzed by an unknowing third party.


## 6. Conclusions

The proposed paper shows a way in which the properties of the quantum information processing universe are used when designing a voting scheme. The article presents the details of a voting system, which allows its participants to select a candidate, by choosing an index associated with it. Multiple voters express their option and after the vote ends, a server counts and validates each vote, these entities having shared a couple of qubits. It can be seen as a two-part system: the first part describes the quantum representation of images (NEQR), together with the application of a steganography technique (LSB), which are used to tell the server that each voter expressed his opinion (actually voted); in the second part, the superdense coding circuit is selected to transmit the vote value. The paper also illustrates the mentioned concepts, by creating and simulating the corresponding circuits, implemented with the help of the Qiskit quantum framework.



---

*Source: 8128754-2022-04-19.xml*