Next Article in Journal
Transient Equivalent Modelling of a Wind Farm Based on QPSO-Based Wind Turbine Fault Ride-Through Control
Previous Article in Journal
Galloping Performance of Transmission Line System Aeroelastic Model with Rime Through Wind-Tunnel Tests
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Quantum-Resistant Cryptography for Smart Metering in Smart Grid Systems

by
Janusz Jabłoński
1 and
Robert Dylewski
2,*
1
Faculty of Computer Science, AGH University of Krakow, al. Adama Mickiewicza 30, 30-059 Kraków, Poland
2
Institute of Mathematics, University of Zielona Góra, Licealna 9 St., 65-417 Zielona Góra, Poland
*
Author to whom correspondence should be addressed.
Energies 2025, 18(5), 1204; https://doi.org/10.3390/en18051204
Submission received: 24 January 2025 / Revised: 16 February 2025 / Accepted: 21 February 2025 / Published: 28 February 2025
(This article belongs to the Section A1: Smart Grids and Microgrids)

Abstract

:
The article proposes a cryptographic system with absolute security features for use in authenticating access to resources in smart grid systems, taking into account prosumer solutions to ensure a high level of security of transactions on the energy market that meet the requirements established in the Directive of the European Parliament of 14 December 2022 no. 2555 NIS2, requiring “dynamic authentication” prior to the release of transaction data for key services, covers energy market operators as a key service and is particularly important for ensuring security. The article presents an innovative cryptographic system that, according to the authors’ knowledge, is the only one in the world that meets the NIS2 requirements in the field of “dynamic authentication” and the Quantum-Resistant requirements intended for distributed systems and smart grids. The proposed solution eliminates vulnerabilities related to digital identity theft and its reuse, i.e., practically eliminates the possibility of impersonation.

1. Introduction

Smart Energy and Prosumer Systems are key elements of the modern energy transformation that support the development of sustainable energy systems. Prosumer Systems and Smart Energy jointly support the sustainable energy transformation, increasing the share of renewable energy sources (RES) and energy efficiency at every stage, from production to consumption. Smart Energy is a modern approach to energy management that uses digital technologies to optimize the production, distribution and consumption of energy. A prosumer is a person or entity that not only consumes energy but also produces it, most often from renewable energy sources, such as photovoltaic panels or wind turbines. The benefits of implementing Smart Energy are primarily greater efficiency and the possibility of balancing and reducing energy losses. “Smart Energy” is an increasingly popular concept of integrated energy systems that use modern and intelligent technologies to monitor, control and optimize the production, distribution and consumption of energy. The aim of “Smart Energy” is to improve energy efficiency and reduce the costs of energy production and distribution. Given the environmentally friendly energy production, reducing greenhouse gas emissions by eliminating fossil fuels from the process of generating electricity, so-called individual “prosumers” are connected to the power grid and are both consumers and producers of electricity from the sun or wind. Currently, a large-scale “Smart Grid” is distributed, consisting of millions of networked solar and wind systems, smart meters, controllers, monitoring computers, data servers, gateways, network management systems and electric vehicle charging stations. Managing such a network involves monitoring and controlling the flow of energy throughout the extensive network infrastructure. Communication between network management systems and devices that produce or store energy (e.g., photovoltaic panels, wind turbines, batteries) and consumers (e.g., electric vehicle charging stations) requires intelligent and secure management of prosumers’ access to resources. In the face of growing threats of hacker attacks, the increasing challenge facing “Smart Energy” is to ensure Cybersecurity without drastically increasing implementation costs [1]. Dynamic authentication, access control (AAA, Authentication, Authorization, Accounting; authentication, authorization and access control to devices), as well as data credibility, are the basic attributes of information security also for Industry 4.0. The attributes of information security are confidentiality, integrity, non-repudiation and availability of data and services offered by IT (Information Technology) systems [2,3]. Most of the attributes of information security are provided by cryptography and cryptographic systems, and one of the basic principles of cryptography presented in 1883 by Kerckhoffs states that the security of crypto-systems should rely on the secrecy of the key and not on the secrecy of the algorithm. Based on these sources [4,5,6] covering the theoretical and practical foundations of cryptology, breaking cryptographic security can be defined as follows:
Definition 1.
Breaking a cryptographic system is any action that allows one to obtain unauthorized access to information, cryptographic keys, or allows the execution of a cryptographic operation assumed to be impossible to perform in time and with resources smaller than those assumed by the system’s security, using analytical, computational or practical techniques.
In order to determine the vulnerability of a cryptographic system to breaking, the level of computational security expressed as a power of two or in bits is determined because the security level often corresponds to the length of the cryptographic key [4,5]. However, in practice, the bit size of the key is not synonymous with the security level of the cryptosystem because different cryptographic systems offer different levels of computational security, often independent of the key size [7]. It is assumed that the security level k means that decryption without knowledge of the decryption key requires performing 2k decryption operations. A person who knows the decryption key assumes k = 0, so they will perform only one decryption operation. It can be assumed that the security level determines the minimum effort to recover the decryption key or to recover the message by an unauthorized user who does not know the decryption key in relation to the effort to decrypt the message by an authorized user who knows the value of the decryption key.
Definition 2.
The computational security level of a cryptosystem is a number of bits expressing the ratio of the number of calculations performed without knowing the decryption key to the number of calculations performed for decryption with knowledge of the key.
It is important to note that in 1949, Claude Shannon, based on the use of three rules, proved the following:
  • The key for encrypting the message is longer than or equal to the encrypted message;
  • The encryption key is generated randomly (not pseudo-randomly);
  • A given key is used to encrypt no more than one message.
Referred to as one-time pad rules (OTP), it is possible to construct an unconditionally secure cryptographic system [8].
The security of a cryptosystem may decrease with progress in the number theory used in cryptanalysis and new, more efficient algorithms, as well as the increase in the computing power of computers. Considering the possible scenarios of the development of cryptanalysis methods and the rapid development of quantum computers, it is recommended to search for cryptographic algorithms and methods that provide resistance to cryptanalysis using quantum computers (Quantum-Resistant) or using known methods and unlimited computing resources, referred to as absolute security. In particular, Commission Recommendation (EU) 2024/1101 of 11 April 2024 assumes support for the use of “PostQuantum” cryptography in the implementation of Directive (EU) 2022/2555 of the European Parliament and of the Council of 14 December 2022 (NIS2) concerning measures for a high common level of security across the Union [9,10]. It is worth noting that NIS2 also refers to energy systems, including Smart Energy. Particular attention is paid to the security of authentication services and electronic transactions covered by Regulation (EU) 2014/910—eIDAS. In particular, as a manifestation of concern for a high level of security and elimination of vulnerabilities related to unauthorized access to resources, including access to critical infrastructure, “minimum technical specifications” for authentication systems have been defined in Regulation (EU) 2015/1502, where a high level of trust requires the use of “dynamic authentication” defined in [11] based on one-time pad cryptography generated on the trusted side, eliminating most of the known vulnerabilities, in accordance with the definition below.
Definition 3.
Dynamic authentication means an electronic process using cryptography or other techniques to provide a means of creating on demand an electronic proof that the subject is in control or in possession of the identification data and which changes with each authentication between the subject and the system verifying the subject’s identity.
However, no practical solution or technology implementing the definitional “dynamic authentication” has been developed so far. In particular, for accountability and security in “Smart Energy”, it is necessary to develop safe and effective authentication methods operating in the environment of low-power devices, such as smart meters and sensors, which may have limited computing power, preventing the implementation of the currently recommended by FIPS Quantum-Resists cryptography based on lattice theory. Ensuring unconditional security in an environment with limited resources requires searching for cryptographic algorithms that can be effectively used and implemented in an environment with limited resources, and one-time pad cryptography in authentication may be an effective and safe alternative to currently used solutions.
In this paper, a new implementation of hybrid cryptography is proposed, and a new concept of asymmetric cryptography with one-time keys for authentication purposes (RSA with OTP) is presented. The new concept of hybrid cryptography uses the RSA algorithm with a hidden shared component of the encryption and decryption keys. A new key exchange protocol has also been proposed, replacing the previously known ones. The new RSA cryptography with OTP meets the requirements of “dynamic authentication” [11], and the key exchange protocol meets the assumptions of Quantum-Resists.
The solutions used so far for authentication systems are presented in the second section. In Section 3, a new cryptographic system for dynamic authentication and a key exchange protocol for RSA with OTP is proposed, along with a demonstrative example. This section also includes a discussion of the obtained results. The last section presents conclusions and possibilities for using the introduced solution.

2. Overview of Authentication Solutions and Systems

Experience from recent decades has shown that weak, easy-to-guess, or hard-coded passwords are a growing cyber threat [12,13]. The 2017 NIST guidelines for authentication and digital identity lifecycle management recommend the use of Password-Based Key Derivation Functions 1 and 2 (PBKDF1 and PBKDF2). PBKDF2 features the derivation of encryption keys with a sliding computational cost to reduce the vulnerability of recovering a “password” using brute-force attacks [14]. In essence, PBKDF2 is a summary of the capabilities and achievements of fixed-key asymmetric cryptography for shared secret authentication and transmitting credentials over an insecure channel in a manner similar to that presented in Algorithm 1.
Algorithm 1. Simple authentication, cryptogram c i shared secret Pass
Input: ks ← (65,537, n), kd ← (d,n), PassPass,
Output: Verify ← “Yes/No”
  • “User” generates a password cryptogram using (1), cPass65,537 mod n,
  • “User” sends a couple {idA,c} to “Verifier” as WEBAplAuth ← {idA,c},
  • “Verifier” confirms for idA’sPass.
  • “Verifier” performs decryption using (2), Pass’cd mod n.
  • “Verifier” authenticates:
    5.1
    Verify ← Yes if Pass’ = Pass
    5.2
    Verify ← No if Pass’Pass.
Previous reference authentication methods such as RFC7519 JSON (JavaScript Object Notation) Web Token [15] or PBKDF2 [14] but also SCRAM [16] using a shared secret such as “password” and asymmetric cryptography and hashing used an authentication scheme similar to the diagram shown in Figure 1 in a manner similar to that described by Algorithm 1. The shared secret “Pass” was stored as secured with the MD5 or SHA256 hash function, and additional security elements called “salt” and “pepper” or time stamps made it difficult to guess the “password” [17]. The use of asymmetric RSA or ECC cryptography in encapsulating credentials is vulnerable to “replay” attacks and the use of quantum computers in cryptanalysis. The new FIPS 203 standard published in 2024 [18], key-encapsulation mechanism (KEM) using “lattice theory” can be used by two parties to establish a shared secret key over a public channel. KEM can then be used with symmetric-key cryptographic algorithms to perform basic tasks in secure communications, such as encryption and authentication [18]. Since KEM also uses a fixed key, it does little to address vulnerabilities associated with absolutely secure authentication.
In order to defend against unauthorized access to systems, relying on username and password combinations does not provide sufficient protection against replay attacks and does not eliminate the vulnerability of spoofing, e.g., stolen credentials [1,12,13]. Using two-factor or multi-factor authentication methods increases security by adding a layer of verification, but these solutions are still not effective enough and are not resistant to known threats. Paper [19] presents the implementation of blockchain technology as a form of 2FA. The obtained results suggest that blockchain-based 2FA methods can strengthen digital security compared to conventional 2FA methods. Paper [20] proposed a new privacy-protected authenticated key agreement scheme for secure communication between smart meters and energy suppliers. The experiments carried out showed that the proposed authentication scheme outperforms others in terms of computational costs and resistance to various types of attacks [12,13]. In particular, it is better than the security scheme based on symmetric key encryption and public key encryption combined with elliptic curve cryptography [21]. However, as Cloude Shanon [8] showed, meeting the requirements of absolute security and Quantum-Resists is only achievable by using OTP cryptography, which also provides sufficient protection against replay attacks and other known methods of breaking cryptographic systems.
The problem of distributing one-time keys is indicated as the basic problem of using OTP cryptography in authentication. Article [22] presents the first use of the quantum key distribution (QKD) protocol in authenticating communication for a smart power grid. It shows the feasibility of using QKD to improve the security of critical infrastructure, indicating its use in future distributed energy resources (DER), such as energy storage. Smart Energy management, distribution and billing systems, in particular, require secure authentication. QKD authentication in DER has a significant additional advantage because it requires fewer random bits from QKD than full data encryption; however, quantum technologies are still too expensive to use on a large scale in IoT or smart grid systems.
It is obvious that smart grid technology brings users significant benefits in terms of efficiency and savings; however, various types of attacks can destabilize the operation of smart grids and falsify electricity consumption data. Even data transmitted between smart meters and the energy distribution server can generate not only incorrect energy invoices and other inconveniences but can also disrupt the proper operation of the energy system, even leading to a blackout in the energy sector.

3. Materials and Methods

For authentication, the RSA algorithm and modular exponentiation can be used directly, with encryption described by Equation (1) and decryption described by Equation (2):
c i = m i s   m o d   n
m i = c i d   m o d   n
where n = pq—product of the prime numbers p and q, s—encryption exponent, d—decryption exponent.
Assuming notations as in (1) and (2), the encryption key is the pair {s, n} and the decryption key is the pair {d, n}. The encryption key ks = {s, n} and the decryption key kd = {d, n} are related by the relation (3), which allows us to determine the values of the exponents based on the following equation:
s · d 1   m o d   φ ( n )   when   d e 1   m o d   φ ( n )
where φ n = φ p q = p 1 · q 1 is the number of coprime numbers of n, otherwise known as Euler’s totient.
Knowledge of the value of φ(n) is crucial for correctly determining the values of the exponents s and d. The correct operation of the RSA algorithm requires that the greatest common divisor GCD(s,φ(n)) = 1.
The traditional use of the RSA algorithm assumes that the encryption key {s, n} is shared as a public key and the decryption key {d, n} is a secret key protected from disclosure. The key commutative principle in RSA allows the use of the RSA algorithm in authentication. Assuming that the private secret key is ks = {s, n} and the public key is kd = {d, n}, it is possible to use RSA to authenticate the message mi, assuming that mi = “Pass” is the shared secret “Pass”. Since, knowing the value of {s, n}, one can prepare the ciphertext c i = m i s   mod   n from which, after decrypting m i = c i d   mod   n using the public key {d, n}, the value mi, which is the shared authentication secret “Pass”, will be recovered. It is worth emphasizing that only someone who knows the values {s, n} is able to prepare a ciphertext ci, from which, after decrypting with the public key {d, n}, the expected value mi of the shared secret “Pass” will be decrypted.
Regardless of whether the RSA algorithm is used to hide the shared secret “Pass” in the model with the public encryption key {s, n} as in Figure 1 or in the model with the secret encryption key {s, n}, the security of the RSA algorithm is based on the difficulty of determining the value of one of the secret keys: encryption or decryption. Determination of the secret key leads to breaking the security and compromising the cryptographic system. The assumption that finding the secret exponent of modular exponentiation in RSA requires solving the Discrete Logarithm Problem (DLP), which is the high level of security of the RSA algorithm, turned out to be incorrect.
In order to break the RSA cryptosystem, it is enough to find the factorization of n into prime factors p and q and determine φ n = p 1 · ( q 1 ) and then use Equation (3) to determine the exponent of the secret key d   s 1 m o d φ ( n ) or s d 1 m o d φ ( n ) . Using GNFS (General Number Field Sieve) or using a quantum computer and Shor’s algorithm, cryptanalysis of the RSA algorithm is possible and efficient enough that the use of quantum computing (QC) would threaten the security of RSA and other known cryptosystems.

3.1. Proposed Cryptographic System for Authentication

Considering the susceptibility of the RSA public-key algorithm to cryptanalysis using GNFS or Shor’s algorithm and quantum computers, it is possible to propose absolutely secure authentication by hiding the cryptanalysis-susceptible value of the product n = pq and changing it after each use. Furthermore, one can assume that the decryption exponent d will not change d = const. Assuming that n0 can adopt any value of the shared secret established during the first contact with any distribution as a product of powers of prime numbers, then each subsequent module of cryptographic keys k s i = { s i , n i + 1 } and k d i = { d i , n i + 1 } must satisfy RSA assumptions.
Therefore, each of the modules ni+1 = pi+1qi+1 will be the product of two prime numbers and will constitute a shared secret that will change its value after each use according to Definition 3. If, in addition, d = 65,537, then the determination of the ciphertext ci of the message mi is described by Equation (4) and the decryption by Equation (5):
c i = m i s i m o d   n i + 1
m i = c i d   m o d   n i + 1 = c i 65,537   mod   n i + 1
In the proposed cryptosystem for mi = const and decryption exponent d = 65,537, each time the value of ni+1 changes based on (3), the value of the secret encryption key will also change k s i = { s i , n i + 1 } and only knowing the values of pi+1 and qi+1 is it possible to determine the new exponent si from (3). Moreover, not knowing the proper value of each subsequent module ni+1 being a component of the encryption and decryption key, it is possible to decrypt many different values lilj from any ciphertext ci, and only knowing the proper value of ni+1 will correctly decrypt the value mi from the ciphertext ci.

Demonstration Example

For the purposes of demonstration, it is possible to assume that pi+1 and qi+1 are 5-bit prime numbers. Table 1 shows all possible products ni+1 = pi+1qi+1 satisfying the RSA assumptions.
The number of products ni+1, which is the cardinality of the set |ni|, can be determined as the number of two-element combinations without repetitions using the binomial symbol. Assuming the cardinality of the factor set as the main element p i + 1 , q i + 1 5 for prime numbers of 5-bit size (pi+1, qi+1) = {17, 19, 23, 29, 31}, therefore the cardinality of the set p i + 1 , q i + 1 5 = 5 . It is possible to assume that for 5-bit factors, the products ni+1 will be 10-bit in size and n i 10 = > p i , , q i 2 = 5 2 = 5 ! 5 2 ! 2 ! = 10 , and these will be the modules ni+1 ε {323, 391, 437, 493, 527, 551, 589, 667, 713, 899} of values from Table 1 arranged in ascending order. It should be noticed that for the assumed pi+1, qi+1 of the 5-bit size n i 10 = 10 , which, with a constant value of the decryption exponent, assumed for the purposes of the example as d = 67, meeting the RSA requirements, allows for decryption from one ciphertext, e.g., with the value ci = 321, based on (5) n i 10 = 10 | different values of messages li, and only one of them will be the message mi. Correct decryption of the value mi, therefore, requires knowledge of ni+1 used for its encryption. An example of decrypting 10 different values from one ciphertext is presented in Table 2. There are as many different decrypted numerical messages li as |ni|, and for a person who does not know ni+1, all values li ε {111, 298, 206, 366, 230, 453, 168, 482, 137, 540} are equally probable messages mi (marked in the Table 2 by ? li = mi). Therefore, a person who does not know ni+1 used for encryption must guess which of the values li is the message mi.
In the general case, the approximation (6) can be used to determine |pi, qi|:
π x x l n ( x )
where x represents the maximum value of pi and qi.
Determining the cardinality of a set of products n i 256 = | p i · q i | , for (pi+1, qi+1) of 128-bit size can be based on the determination of p i , q i 128 based on (6) by determining the approximate number of primes of 128-bit size and subtracting the primes of 127-bit size, as in Equation (7):
p i , q i 128 π 2 128 π 2 127 = 2 128 l n 2 128 2 127 l n 2 127   2 121 2 120 = 2 120
Based on the estimated value of p i , q i 128 2 120 one can, from (8), determine the cardinality of ni+1 as follows:
n i 256 = p i , q i 128 2 = 2 120 2 = 2 120 ! 2 120 2 ! 2 ! = 2 120 1 2 120 2 2 239
It should be noted that for the purposes of this paper, it was assumed that the value of ni+1 is not disclosed because the modulus ni+1 is a secret shared by the relying and trusted parties. This eliminates the vulnerability to attacks based on factoring n. The previous use of asymmetric cryptography and RSA, in accordance with Figure 1, assumed that n was a component of the shared public key ks = {s, n} and the private secret decryption key kd = {d, n}. With the proposed assumption of secrecy ni+1, to maintain the required RSA security levels, the factors (pi+1, qi+1) of the product ni+1 do not have to be carefully chosen large prime numbers of over 1024 bits, in accordance with the rules for selecting secure RSA keys. In the proposed RSA with OTP, to ensure the required security level of, e.g., 239, it is enough to guarantee that the assumption of dependence (3) is met, which comes down to checking whether the Euler totient φ(ni+1) is relatively prime to the value of the secret encryption exponent si of the encryption key k s i = { s i , n i + 1 } .
Checking G C D s i , φ n i + 1 1 requires much less computational effort than testing primality. Therefore, 128-bit factors can be easily implemented in real time on limited resource devices in Smart Energy grids. However, the problem of securely transferring the value ni+1 to the other party remains to be solved, i.e., how to solve the one-time “Key Distribution Problem” between the encrypting and decrypting parties, because correct decryption of mi without knowledge of the next ni+1 will not be possible.

3.2. Proposed Key Exchange Protocol for RSA with OTP

Considering the vulnerability of the RSA algorithm to attacks aimed at decomposing n into prime factors (p, q) in order to determine φ n = p 1 · q 1 and then determining the exponent d of the decryption key kd from the relation (3) and compromising the system, it was assumed that n is a secret shared between the “User” and “Verifier” parties, which changes with each use assuming ni+1ni. Such an assumption, as shown in the further part of the paper, allows the use of the assumptions of cryptography with OTP keys in order to increase the level of security to the level of absolute security [8]. However, this requires the development and proposal of an absolutely secure key exchange protocol based on the secure determination of ni+1 value between the “User” party being the “encrypting” party and the “Verifier” party being the “decrypting” party, i.e., the development of an absolutely secure protocol for exchanging ni+1 value between the encryption participants. Based on the incremental FPGA reconfiguration protocol using a differential stream [23,24], it is possible to propose a key exchange protocol using the incremental structure not of “bitstreams” reconfiguring the FPGA but related to the difference (9) of numerical values described by Equation (9):
Δ n i = n i + 1 n i
Based on (9) and (2), the proposed OTP cryptographic system would use a key exchange protocol in which “User” as the encrypting participant according to (4), transmits the ciphertext to the decrypting participant “Verifier” according to (5) the ciphertext c i = m i s i m o d n i + 1 and the value Δni used to reconstruct the current values of the module n i + 1 = n i + Δ n i , which is used as the decryption key kd = {65,537, ni+1} to decrypt the message mi. The proposed scheme for the incremental key exchange protocol in RSA authentication with OTP is presented in Algorithm 2.
Algorithm 2. Differential authentication with cryptogram c i shared secret m i
Input: d ← 65,537, nini, mimi,
Output: Verify ← “Yes/No”
  • “User” generates ni+1 ← new(pi+1qi+1)
  • “User” calculate Si ← 65,537−1 mod[(pi+1−1) ∗ (qi+1 − 1)]
  • “User” encrypt (4) cimiSi mod(ni+1)
  • “User” generates Δ n i     n i + 1 n i ,
  • “user” sends WEBApplAuth ← { i d , c i , Δ n i } to “Verifier”,
  • “Verifier” for id Get(ni, mi)
    6.1
    “Verifier” generate ni+1ni + Δni
    6.2
    “Verifier” decrypts (5) m i c i 65,537   mod ( n i + 1 )
  • “Verifier” authenticates:
    7.1
    Verify ← Yes if mi = mi,
    7.2
    Verify ← No if mimi.
The diagram in Figure 2 shows the authentication process using incremental key exchange (9) and a protocol consistent with Algorithm 2.
According to the example described in Table 2, for one ciphertext value ci, different messages l are decrypted, and only using the correct value ni+1 allows the recovery of the message mi. Therefore, an authentication protocol using one-time ni+1ni will be secure if it is not possible to uniquely recover the value ni+1 based on Δni.

3.2.1. Demonstration Example

Using the example of 5-bit factors |pi, qi|5 =>{17, 19, 23, 29, 31} products satisfying the RSA requirements according to Table 1, it is |ni| = 10, while the possible differences (9) are shown in Table 3.
In Table 3, the repeated values Δni = {46, 114, 186, 276} are marked in colors (46—blue, 114—red, 186—green, 276—brown). This means that if Δni = 46, then the values ni+1 = ni + Δni can be the numbers 437 = 391 + 46 or 713 = 667 + 46. Therefore, based on Table 2, from one ciphertext with the value of, for example, ci = 316, two different values l can be decrypted, where one is l1 = 206 for ni+1 = 437 and the value l2 = 137 for ni+1 = 713, and each of these values li ε (206, 137) with probability equal to ½ can be the encrypted message mi. A similar situation occurs for the remaining repeated values Δni. So, even knowing the value of Δni, there is no certainty what value of ni+1 was used, and the probability that the decrypted message is mi forΔni = {46, 114, 186, 276} is ½.
In the example for 5-bit values (pi+1, qi+1), not all Δni values are repeated, so we are not sure that for arbitrarily chosen ni+1 and ni, the Δni values will belong to the set {46, 114, 186, 276}, repeating values for which the probability that the decrypted value is mi is ½, however, for repeating Δni, the general probability relation is described by (10):
p m i = 1 n i
where |Δni| is the cardinality of the set of difference repetitions ni+1ni.
In the general case, the cardinality Δni can be determined from the binomial symbol of the cardinality of the set of possible products |ni+1|r, where r is the bit size of r = l o g 2 n i + 1 . Assuming that the products ni are of size r = 256 bits, it is possible to assume from (8) that the cardinalities ni+1 = |ni|256 ≅ 2239, then the cardinality Δni for ni+1 of 256-bit size is as follows:
n i 256 = n i 256 2 = 2 239 2 = 2 239 ! 2 239 2 ! 2 ! = 2 239 1 2 239 2 2 477
It should be noted that for ni+1 of 256-bit size, the cardinality of |Δni| is close to 2477, where the Δni values are even values of size at most 256 bits since |Δn|256 is approximately equal to 2477; therefore, the assumed Δni values of 256-bit size must repeat, similarly as the selected values Δni ={46, 114, 186, 276} repeat in the example for pi+1 and qi+1 of 5-bit size. Assuming that the distribution of Δni values is uniform, then the average value of the repetitions of the Δni values expressed in the cardinality of the set of repetitions of the values |Δni|256 will be as follows:
| n i | 256 = | n | 256 2 256 = 2 477 2 256 = 2 477 256 = 2 219 .
Thus, based on (10) for 256-bit ni and the proposed RSA with OTP, knowledge of Δni and the ciphertext ci allows us to determine mi with the probability determined based on (10) of p m i 1 2 219 equivalent to the probability of guessing the value ni+1. It is worth noticing that the use of quantum computers and, for example, the “Shor” or “Grover” algorithm to break the proposed key exchange protocol would first require “guessing” which of the 2219 possible values of ni+1 was used; at present, even quantum computers do not have the ability to “guess”.

3.2.2. Efficiency of RSA Authentication with OTP

The proposed authentication protocol, consistent with Figure 2, with RSA encryption with variable modules ni+1 determining one-time values of the secret–private encryption exponent k s i was implemented and launched as a service process called “gen” simulating activities performed on the trusted side “User” generating values ni+1 and Δni, as well as preparing the ciphertext ci. Moreover, authentication was implemented as the “auth” process of authentication with values generated by “gen”, assuming that mi is the current time read from the system.
The implementation platform was the http server “flask” on RaspberryPi 4 ver. B with 4 GB of memory [25]. The average value of response times takes into account the Transport Control Protocol/Internet Protocol (TCP/IP). Two methods were implemented in Python 3.11.2on Raspberry Pi: “gen” run on TCP/IP port number 6000 and “auth” run on TCP/IP port number 5000. The “gen” method realizes the algorithm 2 steps “User” from 1 to 5, and the “auth” method realizes the algorithm 2 steps 6 and 7. In addition, two client programs written in Python were implemented on the PC computer in the Jupyter Notebook 3.9.5 environment. One sending data (idA, ci, Δ n i ) via the “Post” method to the “flask” server IP port 5000 to the “auth” method, waiting for a “Yes/No” response. The second program on the PC in the Jupyter Notebook environment in Python ran the “gen” method for the “User” of idA, expecting data (idA, ci, Δni) in response. The programs running in the PC environment measured the time between sending the query to the “gen” and “auth” methods, as connection delays for http when performing 10 attempts for each bit size: 256, 512, 1024, 2048 and ninj, are presented in Table 4.

3.3. Discussion of the Obtained Results

The key exchange protocol proposed in the paper for authentication using the proposed RSA with OTP uses ni+1 of 256-bit size and the well-known RSA algorithm. The use of ni+1ni changing with each authentication makes the proposed authentication resistant to replay attacks and fully compliant with the recommendations for “dynamic authentication”, and the key exchange protocol meets the requirements of Quantum-Resists. Moreover, subsequent values ni+1 = pi+1qi+1 are generated on the trusted side and are never disclosed, so ni+1 does not have to meet the requirements of strong cryptographic security.
It should be noted that already for ni of size 10 bits, for selected known and repeated values Δni, p m i = 1 / 2 , i.e., indicating the correct value of mi requires guessing. With the increase in the size ni, the probability of indicating the correct value p m i decreases, and for ni of size 256 bits, it is p m i = 1/2219, and the computation time is less than 50 ms. In the implementation, the “Verifier” side should check whether Δni ≠ 0, as Δni = 0 may indicate a replay attack attempt. On the “User” side, it is necessary to verify that the values of pi+1 or qi+1 are not the largest possible prime numbers of the given size.
The proposed solution can be modified by replacing nini+1 in Algorithm 2 on the “User” and “Verifier” side after each successful authentication transaction; then, even a ni leak is not dangerous because it loses its validity after each authentication.
It is worth noting that the algorithms based on “lattice-cryptography” still implement the traditional asymmetric cryptography model with keys of a few kilobits, while the proposed solution meets the Quantum-Resists requirements with ni size of 256 bits and easily cooperates with hashing algorithms such as SHA256 [17]. FIPS 203 proposes a key encapsulation protocol; however, it requires careful selection of key values 10 times larger and still does not meet the probability requirement p m i 1 / 2 .

4. Conclusions and Future Applications

Both of these areas, Prosumer Systems and Smart Energy, are changing the way we approach energy production and consumption. The phenomenon of energy decentralization, the increase in the number of prosumers, and the development of Smart Energy technologies are changing the traditional energy model to a more sustainable, flexible and technology-based one. In the future, it is expected that technologies such as the Internet of Things (IoT), 5G and smart power grids will continue to develop, supporting Prosumer Systems and Smart Energy
In relation to other solutions, this is the first hybrid cryptographic system in the full sense of the word, in which two different keys, k s i k d and a “secret” shared component ni+1, are used, the component that changes with each use of the cryptosystem. Additionally, an absolutely secure “one-time key agreement protocol” has been proposed as a key exchange protocol. The proposed RSA cryptography solution with OTP is the only one in the world that meets the requirements of “dynamic authentication” and can successfully replace QKD. The proposed dynamic authentication technology can replace existing authentication systems based on asymmetric cryptography without major changes and supplement, for example, RFC 7519 JSON WEB Token [15] with a version with one-time keys. The results from Table 4 indicate that the proposed solution performs the “gen” and “auth” operations practically in real time. The proposed solution eliminates vulnerabilities related to digital identity theft and its reuse, i.e., practically eliminates the possibility of impersonation. Already for 256 bits, it meets the requirements of Quantum-Resists and is the first in the world to meet Definition 3 for “dynamic authentication” and eIDAS for NIS2.
In further research, the authors also plan to introduce the possibility of incremental change in the decryption exponent, i.e., use variable values di+1 instead of the constant d = 65,537.

Author Contributions

Conceptualization, J.J.; methodology, J.J. and R.D.; software, J.J.; validation, J.J. and R.D.; formal analysis, J.J. and R.D.; investigation, J.J.; resources, J.J.; data curation, J.J.; writing—original draft preparation, J.J. and R.D.; writing—review and editing, J.J. and R.D.; visualization, J.J.; supervision, J.J. and R.D.; project administration, J.J. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Dataset available on request from the authors.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Arampatzis, A. Top 10 Vulnerabilities that Make IoT Devices Insecure. 2023. Available online: https://venafi.com/blog/top-10-vulnerabilities-make-iot-devices-insecure/ (accessed on 5 December 2024).
  2. Kagermann, H.; Lukas, W.D.; Wahlster, W. Industrie 4.0: Mit Dem Internet der Dinge Auf Dem Weg zur 4. Industriellen Revolution, 2011. Available online: https://www.vdi-nachrichten.com/Technik-Gesellschaft/Industrie-40-Mit-Internet-Dinge-Weg-4-industriellen-Revolution (accessed on 5 December 2024).
  3. Schwab, K. The Fourth Industrial Revolution; Penguin: New York, NY, USA, 2017. [Google Scholar]
  4. Katz, J.; Lindell, Y. Introduction to Modern Cryptography; CRC Press: Boca Raton, FL, USA, 2014; Available online: https://eclass.uniwa.gr/modules/document/file.php/CSCYB105/Reading%20Material/%5BJonathan_Katz%2C_Yehuda_Lindell%5D_Introduction_to_Mo%282nd%29.pdf (accessed on 12 December 2024).
  5. Menezes, A.J.; von Oorschot, P.C.; Vanstone, S.A. Handbook of Applied Cryptography; CRC Press/Taylor&Francis Group: Boca Raton, FL, USA, 1997; ISBN 978-0-84-938523-0. [Google Scholar]
  6. Stallings, W.; Borwn, L. Computer Security; Pearson: New York, NY, USA, 2018. [Google Scholar]
  7. Stallings, W. Kryptografia i Bezpieczeństwo, Matematyka Szyfrów i Techniki Kryptologii; Helion: Gliwice, Poland, 2011. [Google Scholar]
  8. Shannon, C. Communication Theory of Secrecy Systems. Bell Syst. Tech. J. 1949, 28, 656–715. [Google Scholar] [CrossRef]
  9. Enisa. Post-Quantum Cryptography: Current State and Quantum Mitigation, 2021. Available online: https://www.enisa.europa.eu/publications/post-quantum-cryptography-current-state-and-quantum-mitigation (accessed on 15 November 2024).
  10. Enisa. EU’s First Ever Report on The State of Cybersecurity in the Union, 2024. Available online: https://www.enisa.europa.eu/news/eus-first-ever-report-on-the-state-of-cybersecurity-in-the-union (accessed on 15 November 2024).
  11. Technical Specifications and Procedures for Assurance Levels. Available online: https://www.legislation.gov.uk/eur/2015/1502/adopted (accessed on 5 December 2024).
  12. Trevino, A. Jak Słabe Hasła Prowadzą do Ataków z Użyciem Oprogramowania Wymuszającego Okup, 2024. Available online: https://www.keepersecurity.com/blog/pl/2024/02/29/how-weak-passwords-lead-to-ransomware-attacks/ (accessed on 15 November 2024).
  13. Błędy w Protokołach Kryptograficznych, 2002. Available online: https://ipsec.pl/bdy-w-protokoach-kryptograficznych.html (accessed on 15 December 2024).
  14. NIST. Digital Identity Guidelines. Authentication and Lifecycle Management. 2017. Available online: https://pages.nist.gov/800-63-3/sp800-63b.html (accessed on 5 November 2024).
  15. Jones, M.; Bradley, J.; Sakimura, N. JSON Web Token, 2015. Available online: https://datatracker.ietf.org/doc/html/rfc7519 (accessed on 5 December 2024).
  16. Newman, C.; Menon-Sen, A.; Melnikov, A.; Williams, N. Mechanizm Uwierzytelniania Metodą Salted Challenge Response (SCRAM) SASL i Mechanizmy GSS-API, RFC 5802, 2010. Available online: https://www.rfc-editor.org/info/rfc5802 (accessed on 5 November 2024). [CrossRef]
  17. Melnikov, A. Salted Challenge Response Authentication Mechanism (SCRAM) SASL and GSS-API Mechanisms, 2024. Available online: https://www.ietf.org/archive/id/draft-melnikov-scram-bis-05.html (accessed on 10 November 2024).
  18. NIST. Module-Lattice-Based Key-Encapsulation Mechanism Standard, 2024. Available online: https://csrc.nist.gov/pubs/fips/203/final (accessed on 5 November 2024).
  19. McCabe, C.; Mohideen, A.I.C.; Singh, R. A Blockchain-Based Authentication Mechanism for Enhanced Security. Sensors 2024, 24, 5830. [Google Scholar] [CrossRef]
  20. Hammami, H.; Yahia, S.B.; Obaidat, M.S. Scalable and efficient authentication scheme for secure smart grid communication. IET Netw. 2020, 9, 165–169. [Google Scholar] [CrossRef]
  21. Wu, D.; Zhou, C. Fault-tolerant and scalable key management for smart grid. IEEE Trans. Smart Grid. 2011, 2, 375–381. [Google Scholar] [CrossRef]
  22. Alshowkan, M.; Evans, P.G.; Starke, M.; Earl, D.; Peters, N.A. Authentication of Smart Grid Communications Using Quantum Key Distribution, Scientific Reports. 2022. Available online: https://www.nature.com/articles/s41598-022-16090-w (accessed on 12 December 2024).
  23. Jabłoński, J.; Wojtowicz, M. Bezwarunkowo bezpieczny system kryptograficzny. Logistyka 2014, 5, 611–616. [Google Scholar]
  24. Jabłoński, J. System Szyfratora z Kluczem Jednorazowym; Patent 218339; Urząd Patentowy Rzeczypospolitej Polskiej: Warszawa, Poland, 2014. [Google Scholar]
  25. Raspberry Pi, Raspberry Pi 4, 2024 Specification. Available online: https://www.raspberrypi.com/products/raspberry-pi-4-model-b/ (accessed on 5 November 2024).
Figure 1. Shared secret Pass encryption authentication.
Figure 1. Shared secret Pass encryption authentication.
Energies 18 01204 g001
Figure 2. RSA encryption authentication with shared secret mi one-time keys.
Figure 2. RSA encryption authentication with shared secret mi one-time keys.
Energies 18 01204 g002
Table 1. Possible products ni+1 = pi+1qi+1 when pi+1qi+1 of 5-bit size.
Table 1. Possible products ni+1 = pi+1qi+1 when pi+1qi+1 of 5-bit size.
n i + 1 = p i + 1 · q i + 1 1719232931
17-323391493527
19--437551589
23---667713
29----899
31-----
Table 2. Decrypted values mi from ciphertext ci = 321 for different ni+1.
Table 2. Decrypted values mi from ciphertext ci = 321 for different ni+1.
i+1nidci? li = misiΦ(ni+1)
13236732111143288
239167321298331352
343767321206331396
449367321366107448
55276732123043480
655167321453331504
758967321168403540
866767321482331616
971367321137463660
1089967321540163840
Table 3. Possible differences Δni = ni+1ni for 5-bit pi+1, qi+1.
Table 3. Possible differences Δni = ni+1ni for 5-bit pi+1, qi+1.
ni+1ni323391437493527551589667713899
323068114170204228266344390576
391−68046102136160198276322508
437−114−4605690114152230276462
493−170−102−560345896174220406
527−204−136−90−3402462140186372
551−228−160−114−58−24038116162348
589−266−198−152−96−62−38078124310
667−344−276−230−174−140−116−78046232
713−390−322−276−220−186−162−124−460186
899−576−508−462−406−372−348−310−232−1860
Table 4. Process times of “gen” and “auth” for different bit sizes ni+1.
Table 4. Process times of “gen” and “auth” for different bit sizes ni+1.
ni+1 [bits]gen” [ms]auth” [ms]
2564626
51210226
102451124
2048578826
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

Jabłoński, J.; Dylewski, R. Quantum-Resistant Cryptography for Smart Metering in Smart Grid Systems. Energies 2025, 18, 1204. https://doi.org/10.3390/en18051204

AMA Style

Jabłoński J, Dylewski R. Quantum-Resistant Cryptography for Smart Metering in Smart Grid Systems. Energies. 2025; 18(5):1204. https://doi.org/10.3390/en18051204

Chicago/Turabian Style

Jabłoński, Janusz, and Robert Dylewski. 2025. "Quantum-Resistant Cryptography for Smart Metering in Smart Grid Systems" Energies 18, no. 5: 1204. https://doi.org/10.3390/en18051204

APA Style

Jabłoński, J., & Dylewski, R. (2025). Quantum-Resistant Cryptography for Smart Metering in Smart Grid Systems. Energies, 18(5), 1204. https://doi.org/10.3390/en18051204

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