Software implementation of systematic polar encoding based PKC-SPE cryptosystem for quantum cybersecurity

The ever-growing threats in cybersecurity growing with the rapid development of quantum computing, necessitates the development of robust and quantum-resistant cryptographic systems. This paper introduces a novel cryptosystem, Public Key Cryptosystem based on Systematic Polar Encoding (PKC-SPE), based on the combination of systematic polar encoding and public-key cryptographic principles. The Systematic Polar Encoding (SPE), derived from the well-established field of polar codes, serves as the foundation for this proposed cryptographic scheme. Here, we have used MATLAB Software to introduce and implement the PKC-SPE Cryptosystem. The paper examines key generation, encryption, and decryption algorithms, providing insights into the adaptability and efficiency of systematic polar encoding in public-key cryptography. We assess the efficiency of the PKC-SPE Cryptosystem in three aspects: key size, computational complexity, and system implementation timings. In addition, we compare the PKC-SPE Cryptosystem with PKC-PC cryptosystem and find that it has reduced key sizes (\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$P_{r}$$\end{document}Pr = 0.8436 kbytes). The results obtained through simulations validate the effectiveness of the proposed cryptosystem and highlighting its potential for integration into real-world communication systems. Thus, in the paradigm shift to quantum computing, the PKC-SPE cryptosystem emerges as a promising candidate to secure digital communication in the quantum computing era.

applications may benefit from polar codes because of many characteristics: It is believed that polar codes are used in various cryptosystems because of their error-correcting abilities, low complexity, and encoding and decoding algorithms that are used to reduce the size of the cryptosystem's keys 14 .SPE algorithms combine error-correction with the advantage of maintaining the original information bits in their systematic form.By preserving these bits, error detection and correction can be improved, resulting in a lower Bit Error Rate (BER) 15 .The recursive nature of polar codes makes them suitable for real-time communication systems, cryptographic protocols, and storage technologies.As a result, polar codes are more practical for real-world applications because of their systematic nature, making a significant contribution to coding theory and cryptography 7 .In recent years, many variants 10,11,16,17 of the McEliece encryption scheme based on polar codes have been addressed by several researchers.Kim 10 introduced a new version of the McEliece cryptosystem 6 using Polar Codes to increase the performance of the original McEliece encryption scheme.Later, Hooshmand et al. 11,18 attempted to use polar codes to reduce the key length of the McEliece cryptosystem.Then, Aref 12 proposed a non-systematic polar code-based secret key cryptosystem.Finally, PKC-PC (Public Key Cryptosystem based on Polar Codes) 19 features an IND-CCA2 version to validate its security .These variants are based on non-systematic polar codes had reduced the key sizes upto a larger extent but still these variants are resistant against classical attacks not against quantum attacks.Our proposed cryptosystem employs Systematic Polar Encoding 20 , which is expected to be more resistant to error propagation while simultaneously reducing key size to a greater extent.Here, we have introduced Systematic Polar Encoding (SPE) 20 in the structure of McEliece's cryptosystem over the Additive White Gaussian Noise (AWGN) channel.

Our contribution
The PKC-SPE cryptosystem 15 , which effectively employs Systematic Polar Encoding (SPE) 20 , is implemented to address the flaws of conventional cryptosystems.The SPE exhibits better error performance as compared to its non-systematic counterparts 20 , enhancing the robustness of the cryptosystem.The combination of simplicity, excellent error correction performance, low complexity decoding, and adaptability makes systematic polar encoding an alternative for communication systems where reliability, efficiency, and ease of implementation are important considerations.The paper aims to explore the potential of combining systematic polar encoding and public key cryptography to address the challenges of secure key exchange and confidential communication.Our paper's main contribution is randomly selecting good bit channels to hide the generator matrix, preventing the adversary from obtaining the polar code generator matrix.The PKC-SPE cryptosystem also benefits from smaller public and private key sizes, particularly at the high-security level.Additionally, its evaluation for efficiency (implementation timings, key sizes, and computational complexity) is discussed.The key length of various blocklengths is compared with existing cryptosystems with the same security level.This paper aims to enhance security, improve efficiency, enable practical implementation, and explore potential post-quantum solutions, ultimately contributing to the advancement of cryptographic systems for secure communication.

Implementation of the PKC-SPE cryptosystem
In this section, we will provide an overview of the processes required to construct the PKC-SPE Cryptosystem.We construct the cryptosystem by computing the Bhattacharyya parameters for a given polar code (X, K), with rate R. Bhattacharyya parameters are organized in increasing order, in which the leftmost XR indices correspond to the good bit channels (A) and the rightmost X(1-R) indices correspond to the bad bit channels.The next step is to locate the good bit channels and select the frozen bits ( A c ).A submatrix G AA of generator matrix G A is considered to be a secret generator matrix, and the frozen bits are saved instead of the information bits.Furthermore, the secret generator matrix is also randomized using the random scrambling matrix (S), and the permutation matrix (P).By concealing the generator matrix from the opponent, the message m of length K-bits is encoded to obtain a ciphertext c of length X-bits as follows: where u A = mS and u A c is taken as zero vector.This structure embeds the original information bits into the encoded sequence, which simplifies encryption and decryption algorithms.The systematic property of this algorithm makes it useful for improving error correction capabilities and securing communication channels.In the next step, simulate the encoded vector over an unsecured channel and decode the received vector.In order to determine whether or not the transmission has been successful, we validate the cryptosystem after decryption.The PKC-SPE Cryptosystem's MATLAB code is provided below.

Efficiency assessment
In this section, we assess the efficiency of the PKC-SPE cryptosystem by evaluating the key size, implementation timings (key generation, encryption, and decryption), and computational complexity.These metrics not only provide insights into the performance of the cryptosystem but also play a significant role in evaluating its security against quantum attacks.Quantum computers pose a threat to traditional public key cryptosystems using algorithms like Shor's algorithm to factor large numbers or solve the discrete logarithm problem efficiently.A smaller key size ( P r , P b = 0.8436, 65.25) for polar code (2048, 1741) in PKC-SPE indicates efficient use of the cryp- tosystem, reducing storage requirements, and secure communication over noisy channels.However, it's essential to reduce key size with security considerations to ensure adequate protection against both classical and quantum attacks.Also, quantum computers have the potential to perform certain types of calculations exponentially faster than classical computers.Therefore, evaluating the computational complexity of PKC-SPE is crucial for assessing its security against quantum attacks.Lower computational complexity implies faster encryption and decryption algorithms, which are essential for real-time applications.Additionally, reduced complexity can lead to lower energy consumption and hardware requirements, making PKC-SPE more practical for resource-constrained environments.System implementation timings provide insights into the performance of PKC-SPE under different computational environments and also demonstrate practical efficiency in real-world applications.With efficient implementations, quantum-resistant cryptography can be seamlessly integrated into existing infrastructures and become widely adopted.Thus, it's essential to explore the trade-offs between key size, computational complexity, and system implementation timings in the context of PKC-SPE.

Key length
Both the public and private keys in the proposed cryptosystem are generated as follows: • The proposed cryptosystem's private key is given by set P r = {A c , P} 18 , where the set A c is being saved in place of generator matrix G A .These bit channel indices require log 2 (X) bits to save in binary form.Hence, the maximum bound of memory to save A c is calculated as M A c ≤ log 2 (X)(X − K) .The memory required to store the permutation matrix P is calculated as M P = log 2 (X!) .Therefore, the maximum bound of memory required to store the private key is calculated as M Pr = M A c + M P .By taking the (1024,768) Polar Code, we obtained M P r = 0.4262 kbytes.• The public key ( P b ) consists of the structured encryption matrix of the form [I K |T] 18 , which requires K(X-K) bits instead of KX bits.By taking the (1024, 768) Polar Code, we obtained M P b = 24.576kbytes.
The bit sizes of both the private and public keys for different blocklengths are being shown in Table 1 and Fig. 1.

Computational complexity
The proposed cryptosystem's complexity is divided into two parts: encoding complexity(C enc ) and decoding com- plexity(C dec ) .The cryptosystem is being encrypted by calculating the product mG A and by adding the intended error vector e.As a result, the encoding complexity is defined as C enc = C(mG A ) + C(e) , where C(mG A ) = O(K(X-K)) is the binary operations required to obtain the product(mG A ) and C(e) = X is the binary operations required to add X-bit intended error vector.Similarly, the decoding complexity can be expressed asC dec = C (yP  www.nature.com/scientificreports/+C(y −1 )+C(u A c ) , where C (yP −1 ) = O(X) is the binary operations required to calculate (yP −1 ) 11 .Furthermore, the complexity of SC decoding is calculated as C (y −1 ) = O(Xlog X) and O(K 2 ) is the binary operations required to obtain u A .Thus, C(u A )= O(K 2 ) .The Table 2 shows the encryption and decryption complexity of the proposed cryptosystem.

Implementation timings
We have implemented the proposed cryptosystem on an 11th Gen Intel (R) Core(TM) i5 − 1135G7@2.40GHZprocessor.This part presents implementation timings (Key Generation, Encryption, and Decryption timings) for various blocklengths using the MATLAB Software 21 .The results for each blocklength are computed by executing 1000 random messages and averaging the execution time.Table 3 and Fig. 2 shows our cryptosystem's implementation timings (in seconds) for various blocklengths.From Fig. 2, we find that the decryption algorithm takes least time in the PKC-SPE cryptosystem.

Ethics approval
This does not contain any studies with human participants or animals performed by any of the authors.
Table 2. Complexity of the proposed cryptosystem.

Complexity
Encryption complexity Decryption complexity

Comparison with similar existing schemes
The proposed PKC-SPE cryptosystem is being compared to existing schemes 14 in this section.This section evaluates the efficacy and uniqueness of the PKC-SPE cryptosystem against similar existing schemes.The strength and practicability of our PKC-SPE cryptosystem are evaluated by evaluating several factors such as key size, computational complexity, encryption and decryption speed, key generation timings, etc.Several relevant tables and figures illustrate the comparison of PKC-SPE to similar existing cryptosystems.In Table 4, we compare key lengths with existing cryptosystems and find that our proposed cryptosystem has shorter key lengths.Table 5 presents the theoretical comparison of computational complexity with McEliece and PKC-PC cryptosystem.Table 6 and Fig. 3 compare the implementation timings of key generation, encryption and decryption algorithms for different block lengths of the proposed cryptosystem, PKC-SPE and already existing PKC-PC 19 cryptosystem.Figure 3 illustrates the comparison of implementation timings between the PKC-SPE and the PKC-PC cryptosystem that demonstrates the effectiveness of PKC-SPE in terms of key generation, encryption and decryption timings.The figure depicts that PKC-SPE exhibits lesser implementation timings as compared to PKC-PC, indicating the efficiency and performance of PKC-SPE in real-world applications.Thus, the results validate the choice of systematic polar encoding in PKC-SPE and demonstrates its practical viability as a promising cryptographic solution.

Conclusion
This paper is an improved version of the McEliece Cryptosystem that uses Systematic Polar Encoding (SPE) in the framework of a public key cryptosystem.The PKC-SPE Cryptosystem is implemented using the MATLAB Software, and its efficiency is evaluated in three aspects: key size, computational complexity, and system implementation timings.The efficiency of the software implementation has been thoroughly examined, emphasizing the cryptosystem's security robustness, computational efficiency, and overall suitability for real-world applications.

Figure 3 .
Figure 3.Comparison of implementation timings of different blocklegths.

Table 1 .
−1 ) Public keys and Private keys for different blocklengths for code rate 0.85.

Table 4 .
Comparing the lengths of keys for PKC-SPE cryptosystem with the existing encryption schemes.

Table 5 .
Theoretical comparison of computational complexity with McEliece and PKC-PC cryptosystem.

Table 6 .
Comparison of implementation timings with PKC-PC cryptosystem.