NTRU-Like Random Congruential Public-Key Cryptosystem for Wireless Sensor Networks

Wireless sensor networks (WSNs) are the core of the Internet of Things and require cryptographic protection. Cryptographic methods for WSN should be fast and consume low power as these networks rely on battery-powered devices and microcontrollers. NTRU, the fastest and secure public key cryptosystem, uses high degree, N, polynomials and is susceptible to the lattice basis reduction attack (LBRA). Congruential public key cryptosystem (CPKC), proposed by the NTRU authors, works on integers modulo q and is easily attackable by LBRA since it uses small numbers for the sake of the correct decryption. Herein, RCPKC, a random congruential public key cryptosystem working on degree N=0 polynomials modulo q, is proposed, such that the norm of a two-dimensional vector formed by its private key is greater than q. RCPKC works as NTRU, and it is a secure version of insecure CPKC. RCPKC specifies a range from which the random numbers shall be selected, and it provides correct decryption for valid users and incorrect decryption for an attacker using LBRA by Gaussian lattice reduction. RCPKC asymmetric encryption padding (RAEP), similar to its NTRU analog, NAEP, is IND-CCA2 secure. Due to the use of big numbers instead of high degree polynomials, RCPKC is about 27 times faster in encryption and decryption than NTRU. Furthermore, RCPKC is more than three times faster than the most effective known NTRU variant, BQTRU. Compared to NTRU, RCPKC reduces energy consumption at least thirty times, which allows increasing the life-time of unattended WSNs more than thirty times.


Introduction
Wireless sensor networks (WSNs) play an important role in the development of the Internet of Things (IoT). WSNs consist of a large number of sensor nodes, battery-supplied devices with a limited memory and computational power microcontroller. WSNs are used widely, e.g., in environmental practices, health, industrial control, military [1], multimedia networks [2], and smart grid networks [3]. WSNs need security and confidentiality since sensitive information is stored, processed, or transferred by sensor nodes [4]. Therefore, cryptographic schemes efficiently working on limited WSN microcontrollers are demanded [5]. Furthermore, energy savings is very important for WSNs [6]. NTRU [7,8] is a public key cryptosystem (PKC) standardized as IEEE P1363.1 and is faster than RSA and ECC [9], and it is applicable to WSNs [10]. Contrary to RSA and ECC working with big numbers and homomorphic only in one operation, multiplication and addition, respectively, NTRU works with high degree, N, polynomial rings and is homomorphic with respect to both multiplication and addition [11]. These features of NTRU allow its use in various applications, such as authentication for smart cards [12], encryption of user data in smart monitoring systems [13], securing of SMS [14], mutual authentication and key agreement for wireless communications [15], embedded systems including microcontrollers and FPGAs [16], Internet of Things devices [17], and NTRU hardware implementation [18]. The NTRU model expects that the public key is used for encryption only by a public user (sender), whereas the private key is used for decryption by the key's owner (receiver).
NTRU and its known variants [7,8,[19][20][21][22][23][24][25][26][27][28][29][30][31][32][33][34][35][36][37][38], shown in Section 2, work with degree N polynomials. The main problem NTRU faces is that it is susceptible to the lattice basis reduction attack (LBRA) using the Gaussian lattice reduction (GLR) algorithm for two-dimensional lattices and the LLL algorithm for higher dimensions [39]. The LBRA using LLL algorithm solves the shortest vector problem (SVP) with exponential in N running time revealing the secret key because the private keys are selected as polynomials with small coefficients for the decryption correctness [40]. To overcome the problem of susceptibility, NTRU uses large N resulting in high computational complexity [11,41]. Therefore, NTRU variants, shown in Section 2, try minimizing NTRU computational complexity by extending the coefficients of the polynomials used or using matrices of polynomials that allow preserving the security level while decreasing the polynomial degree. The extreme case is a polynomial of zero degree, that is integers modulo q >> 1, as used in the congruential public key cryptosystem (CPKC), but CPKC with the NTRU encryption/encryption mechanism is insecure against LBRA by GLR (crackable in about 10 iterations) ( [26], pp. 373-376, 451). Therefore, the CPKC is considered as a toy model of NTRU because "it provides the lowest dimensional introduction to the NTRU public key cryptosystem" [26] (p. 374). The insecurity of CPKC stems from the choice of the private keys used as small numbers to provide decryption correctness. If CPKC could be made resistant to GLR attack, it would be the best possible choice for the NTRU modifications. Therefore, we propose a CPKC modification, random CPKC (RCPKC) [42] (we call it here RCPKC.1).
In this paper, an enhanced RCPKC is proposed by specifying a range from which the random numbers shall be selected based on short vectors returned by GLR attack on it. It provides correct decryption for valid users and incorrect decryption for an attacker using GLR. GLR cannot find its private key because it solves SVP returning the shortest in a lattice vector, whereas our private key is in the safe region (above Minkowski's boundary (27)- (30) for the shortest vector norm of a lattice). On the other hand, the short vectors returned by GLR cannot be used for correct decryption due to our choice of the random numbers. RCPKC is a cryptosystem more secure than NTRU because LBRA is currently considered as one of the most effective attacks against NTRU, and also, a number of other attacks on NTRU are not applicable to RCPKC, whereas RCPKC's resistance to other known attacks on NTRU is similar to that of NTRU. RCPKC is about 27 times faster in encryption and decryption than NTRU. Simplicity, speed, and security make RCPKC a good candidate cryptosystem for WSNs. The paper's contribution can be summarized as follows: • RCPKC, an NTRU-like cipher variant resistant to lattice based attacks, is proposed with enhanced security compared to RCPKC.1 [42].

•
The hardness of the RCPKC one-way (OW) function is proven. • RCPKC symmetric encryption padding (RAEP) is IND-CCA2 secure is proven under the assumption of the hardness of inverting an associated one-way function • RCPKC's performance is justified through implementation and comparison with the state-of-the-art ciphers. • RCPKC's better applicability than NTRU to WSNs is proven.
The rest of the paper is organized as follows. In Section 2, known NTRU variants are presented. In Section 3, an overview of NTRU, NTRU AEP (NAEP), the IND-CCA2 security of NAEP, and CPKC is given, and formulas for CPU power consumption calculation are introduced. LBRA by GLR on CPKC is described, and Minkowski's second theorem is presented in Section 4, used to define a region where GLR attack against the CPKC private key/message fails. In Section 5, RCPKC is presented. In Section 6, the RCPKC security comparison versus NTRU is conducted. In Section 7, the RCPKC OW function and RCPKC asymmetric encryption padding (RAEP) IND-CCA2 security are considered. In Section 8, the RCPKC performance comparison versus NTRU and its variants is presented, and the RCPKC versus NTRU power consumption is studied. Section 9 concludes the paper.

Review of Known NTRU Variants
Many variants of NTRU have been proposed and studied recently, targeting further decreasing its computational complexity. All these variants work with polynomials and mainly differ in the choice of their coefficients, the ring defining polynomial, or the polynomials used as the entries of such structures as matrices. The NTRU variants' overview follows.
NTRU variants differing in the choice of their coefficients. In [27], an NTRU variant, ETRU, was proposed working with polynomials over Eisenstein integer coefficients and was faster than NTRU in encryption/decryption by 1.45/1.72 times. Karbasi and Atani [28] modified ETRU, called ILTRU [28], so that it works with irreducible cyclotomic polynomial over Eisenstein integer coefficients. An NTRU variant, BITRU, working with polynomials over so-called binary numbers, usually known as complex numbers, was proposed in [20]. An NTRU variant, QTRU, working with polynomials over hyper-complex four-component numbers, quaternions, was proposed in [30]. Furthermore, Bagheri and colleagues proposed an NTRU variant, BQTRU, working over quaternions, but with bivariate polynomials, seven times faster than NTRU in encryption [21]. A variant of NTRU working with polynomials over eight-component hyper-complex numbers, octonions, called OTRU, was proposed in [29]. In [34], an NTRU variant, HXDTRU, was proposed working with polynomials over 16-component hyper-complex numbers, hexadecnions, also known as sedenions [19]. Furthermore, a variant of NTRU working with polynomials over 16-component hyper-complex numbers, sedenions, was proposed in [31]. A variant of NTRU, called CTRU, working with polynomials, the coefficients of which are also polynomials in one variable over a binary field, was proposed in [24]. Furthermore, a variant of NTRU working with polynomials, the coefficients of which are polynomials in one variable over a rational field, called BTRU, was proposed in [32].
NTRU variants working with different rings. An NTRU variant that works with polynomials with prime cyclotomic rings was proposed in [35]. A variant of NTRU working with non-invertible polynomials was proposed in [22].
NTRU variants working with polynomials inside more complicated structures. An NTRU variant working with square matrices of polynomials was proposed in [23] and was shown to be 2.5 times better than NTRU encryption and decryption time. An NTRU variant, called NNRU, working with polynomials also being entries of square matrices forming a non-commutative ring, was proposed in [33]. Apart from the polynomial variants, an NTRU-like cipher over the ring of integers, called ITRU, was proposed in [25] without referencing CPKC [26]. In ITRU [25], Table 1, p. 34, the NTRU model specified above was given, but a model for the proposed ITRU was not defined. Its Algorithm 1, [25], p. 35, describes the key generation, and hence, it shall be made by the key owner (receiver). On the other hand, in Section 4. A, Parameter selection, [25], p. 37, the most important parameter, q, was selected by the sender (which encrypts a message using the public key, h = 423,642, and random value, r = 19, in [25], (19), p. 37 with the help of the private keys, f , g , which contradicts the NTRU model: the secret key is known to only the key owner that uses the private key only for decryption, whereas the public key is used for encryption by the public user only.
Thus, the NTRU variants try minimizing NTRU's computational complexity by extending coefficients of the polynomials used or using matrices of polynomials that allow preserving the security level while decreasing the polynomial degree because operations with high-degree polynomials are time-consuming. However, these variants are still susceptible to LBRA using LLL, but with less complexity than NTRU has. Furthermore, ITRU can be used by the key owner only for encryption and decryption messages, but cannot be used by a public user knowing the public key only; hence, it is not compatible with the NTRU model of use.

Overview of NTRU
NTRU [7,8] uses the rings: elements of which are polynomials modulo x N − 1 with coefficients in Z q , Z p , respectively, where p = 2, q > 4d + 1 is prime, N > 3k + 8 is prime, k is the security parameter, and d is the minimal integer such that ( N/2 d/2 )/sqrt(N) > 2 k , where ( m n ) is the number of combinations of n elements out of m. Secret polynomials, f and g, are binary polynomials from D f and D g , with d f = d g = d coefficients equal to one. Both f and g are invertible modulo q. Public key, h, is defined as: where F q is the inverse of f modulo q. A binary message, m = D m ∈ R p , is encrypted using a random binary polynomial r from D r with the d r = N/2 ones as follows: NTRU decryption consists of two steps: Step 1: The private key, f , is applied to (2): (3) Step 2: The inverse of f modulo p is applied to (3) after the polynomial a is centered using the center() function. An implementation of center(), called center1(), provided in [43] (p. 4), follows: 1. Calculate m(1) as e(1) − p · r(1) · h(1), reduced to the interval, 2. Denote a reduced to the interval [0, q − 1] by a. The underline is intended to indicate the minimal possible interval. 3. Calculate a(1). This will differ from p · r(1) · h(1) + f (1) · m(1) by k · q, for some integer, k. 4. Add q to the lowest k entries of a to obtain a reduced into the correct interval. NTRU decryption fails if the following condition does not hold, where Width(p(x)) = max i=0,··· ,N−1 Application of the center() function to the left-hand side (LHS) of (3) makes the second equality in (3) true under Condition (5). For the conditions imposed on NTRU parameters described above, in particular, p = 2, q > 4d + 1, the second equality in (3) holds, and there is no need for centering.

NAEP Description
NAEP uses a function, where p(x) is a polynomial. NAEP encryption is introduced in Algorithm 1.
such that if (m 0 , m 1 , s) ← A 1 (pk), then: where c * ← E (m * , r * ), for some r * ∈ R E and m * = m b * for some b * ∈ {0, 1}. This probability is defined over the choice of r ← R R E , b * ∈ {0, 1}, and k ∈ R K , where R E and R K are defined below. The algorithms (A 1 , A 2 ) have access to a decryption oracle D, which they can call on all but the challenge ciphertext c * , but they must make all hash function calls to H 1 , .., H n public.
An encryption scheme is IND-CCA2 secure if there exist no polynomial (on security parameter) time adversary with a non-negligible advantage. Key generation, encryption, and decryption algorithms are formalized as follows [7]. For a given parameter set P, the encryption scheme is specified by three algorithms: called the key generation, encryption, and decryption algorithms, respectively. The spaces R K , PK, SK, M, R E , C are called the key-gen randomness, public key, secret key, message, encryption randomness, and ciphertext space, respectively.
If (pk k , sk k ) ← K(k), then the algorithms should satisfy: NTRU key, encryption, and decryption procedures and respective spaces are defined in Section 3.1 according to [7]. Polynomials used in NAEP [7,8] for keys are invertible. The NTRU one-way problem is defined as follows: Definition 2. NTRU-OW problem: For a parameter set, P NTRU , we denote by Succ OW NTRU (A, P NTRU ) the success probability of a probabilistic polynomial time (PPT) adversary, A, for finding a pre-image of Assumption 1. NTRU-OW assumption: For every PPT adversary, A, solving the NTRU-OW problem, there exists a negligible function, v A (k), such that for sufficiently large k, it holds: NTRU variants [7,40] can fail (see Section 6.5); hence, it was assumed in [7] that the failure probability is negligible. Under these assumptions, the IND-CCA2 security of NAEP was proven in [7], Corollary 1.

Overview of CPKC
Two secret integers, f and g, are defined as follows: where q is a public integer. The first secret value, f , has inverses modulo g and q, that is F g and F q , respectively, by virtue of (8): A public value, h, is computed using (7) and (9) as follows: Thus, CPKC has the private (secret) key, SK = ( f , g, q, F g , F q ), and the public key, PK = (h, q). The plaintext message, m, meets the following condition: A random integer, r, is chosen as follows:
Step 2: Multiply (14) by F g , getting: where (9) is used and the contributor with the factor g in (14) vanishes due to (15). Numerical Example S1 of CPKC encryption/decryption is in the Supplementary Materials.

Formulas for CPU Power Consumption Calculation
Power, P, and energy, E, are measured in watts (W) and joules (J) [44], respectively, and calculated as follows: where V is the potential difference measured in volts (V), I is the electric current measured in amperes (A), and T is the running time in seconds. There are three contributors to the CPU power consumption: dynamic, short-circuit, and power loss due to transistor leakage currents [45]: Power consumption is mainly defined by the dynamic and leakage components [46]. Leakage power, caused by leakage currents, is present in any active circuit independent of clock rates and is calculated as follows [46]: where V is the supply voltage and I leak is the leakage current. Dynamic power consumption depends on circuit activity (i.e., transistor switches, changes of values in registers, etc.) and is defined as follows [45]: where a is the switching activity factor, C is the capacitance measured in farad (F), and f is the clock frequency measured in hertz (Hz). Mostly, the activity factor is a = 0.5 [47].  (Tables 5-11), is used for RCPKC power consumption evaluation in Section 8.2.

Analysis of LBRA Attack Against CPKC
In this section, LBRA using GLR against the CPKC private key/message is described. Our implementation of GLR attack is shown (Maple 2016.2 is used throughout the paper). A demonstration by an example of how the CPKC private key can be attacked using GLR is presented. Then, a region defined in terms of Minkowski's second theorem where GLR attack fails is shown.

Lattice Basis Reduction Attack by GLR on CPKC Private Key/Message
In the following, ||x||, (x · y), a , and R, denote the Euclidean norm [49] of the vector x, the dot product of the vectors, x and y, the rounding of the real number, a, and the set of real numbers, respectively.
Let E(V 1 , V 2 ) ⊂ R 2 be a two-dimensional lattice with basis vectors, V 1 and V 2 : The GLR algorithm [26] (p. 437), shown in Code 1, upon termination returns the shortest vector v 1 in The CPKC private key recovery problem can be formulated as the shortest vector problem (SVP) in the two-dimensional lattice, E(V 1 , V 2 ). From (10), it can be noticed that for any pair of integers, F and G, satisfying: (F, G) is likely to serve as the first two components, f and g, of the private key, SK [26] (p. 376). Equation (23) can be written as F · h + q · n = G, where n is an integer. Therefore, our task is to find a pair of comparatively small by absolute value integers, (F, G), such that: where V 1 = (1, h) and V 2 = (0, q) are basis vectors, at least one of them having the Euclidean norm of order O(q). Similarly, the CPKC message recovery problem can be formulated as the SVP in the two-dimensional lattice, E(V 1 , V 2 ), where V 1 and V 2 are from (24). It can be also noticed from (13) that for any pair of integers, (RR, EM), satisfying: (RR, EM) is likely to serve as the vector (r, e − m) since the encryption Equation (13) can be written as r · h + q · n = e − m, where n is an integer. Therefore, our task is to find a pair of comparatively small by absolute value integers, (RR, RM), such that: Our aim is to find the shortest vector w from E(V 1 , V 2 ) using GLR that might disclose (r, e − m) if e and r are of the order of O( √ q). Comparing (24) and (26), it is noticed that they are the same up to the unknowns' names used, and hence, finding the shortest vector in E(V 1 , V 2 ) may reveal either the private key components, (F, G) = ( f , g), or the message related vector, (RR, EM) = (r, e − m). Code S1 in the Supplementary Materials presents our Maple [50] implementation of LBRA by GLR based on Code 1. Example S2 in the Supplementary Materials provides an example of LBRA attack using GLR against CPKC.
This section concludes that CPKC can be easily attacked using GLR. In order to modify CPKC to become resistant to GLR attack, first, in Section 4.2, a region where GLR attack fails is shown.

Region Resistant to GLR Attack on the CPKC Private Key/Message
LBRA by GLR succeeds in finding the CPKC private key, since it, by using the settings (7), is likely the shortest vector in the lattice. Minkowski's second theorem [51] (p. 35) sets an upper bound for the norm of the shortest nonzero vector, λ, in a two-dimensional lattice: where [51] (p. 41) and Vol(L) is the volume of the lattice, which is equal to q for the lattice L = E(V 1 , V 2 ) where V 1 and V 2 are defined in (24). Therefore, (27) can be written as follows: where α = √ λ 2 ≈ 1.07. From (28), one gets for the relative norm, the following inequality (30): GLR fails in attacking the CPKC private key/message when (30) is not satisfied for the secret vector relative norm ( f , g), i.e., if: holds, GLR fails to find the CPKC private key/message. CPKC selects small values for private key ( f , g) in (7) to satisfy the decryption correctness condition (15). Hence, our goal is to propose in Section 5 a modification for CPKC, that is RCPKC, where ( f , g) satisfies (31) and provides correct decryption for valid users and incorrect decryption for an attacker using GLR.

The Proposed RCPKC
In this section, random CPKC (RCPKC), an adjustment of CPKC described in Section 3.3, so that it becomes resistant to GLR attack, is proposed.

RCPKC's Main Ideas
The main two ideas of RCPKC are:

•
Contrary to the settings (7) of CPKC, which uses secret key ( f , g) with a small norm not exceeding √ q so that ( f , g) may be found as a shortest vector (SV) in the lattice E(V 1 , V 2 ) defined by (24), RCPKC [42] (we call it in this section RCPKC.1) was originally proposed having private key ( f , g) with a large norm meeting (31) so that it cannot be returned by LBRA using GLR as the SV, but ( f , g) also meets (15) due to the skew in its components. • However, as mentioned in Section 4.1, for any pair of integers, F and G, satisfying (23), (F, G) is likely to serve as the first two components, f , g, of the private key. That means, in spite of the large norm of ( f , g), the SV = (F, G), obtained in the result of LBRA using GLR, may meet the decryption correctness condition (15) and, thus, may be used for the correct plaintext message disclosure (Example S4 shows the LBRA attack using GLR against RCPKC.1; see the Supplementary Materials). That is why RCPKC.1, Section 5.2, before encrypting by (13) (contrary to CPKC using a random number from the predefined range (12)), defines a range for the random number selection using the SV, (F, G) (returned by GLR attack on the lattice E(V 1 , V 2 ) defined by (24)), so that the decryption correctness condition (15) holds for ( f , g), but does not hold for (F, G), which leads to the failure of LBRA using GLR on RCPKC.1. Such an interval defined in (40)-(42) for RCPKC.1 is found to be vulnerable to the GLR attack. Therefore, an enhanced RCPKC proposed herein (we call it in this section RCPKC.2) with a tighter interval for r is defined in (46), (50) and (51), so that such an attack is inactive.
Thus, RCPKC.2 assumes that the private key owner selects a range for a random value, r (used in encryption (13)), based on the secret key, ( f , g), and respective SV, (F, G), in the lattice, E(V 1 , V 2 ), defined by (24), guaranteeing correct decryption for a valid user and incorrect decryption for an attacker using GLR. Because of the special choice of the random value range, the proposed algorithm is called random CPKC (RCPKC). The problem for RCPKC is that the range of random numbers as so defined may be rather narrow, and thus, the security of RCPKC may suffer. However, as will be shown, the range is rather large and may significantly exceed the range for a secret message.

RCPKC.1 Description
To meet (31), it is required that: The LBRA by GLR failure condition (31) holds if (32) is true since: for g, e − m = 0. Condition (32), in RCPKC.1, substitutes the conditions (7) and (12) on f and r in CPKC. The message, m, and the private key, g, instead of (11) and (7), used in CPKC, are redefined in RCPKC.1 as follows: where mgLen represents the length of m and g in bits.
In the following section, RCPKC.1 is modified to RCPKC.2, so that it becomes immune against the LBRA attack.

RCPKC.2 Proposal
In order to resist the GLR attack against RCPKC.1, as shown in Example S3, the definition of the region from which r is selected should consider all SVs with a norm less than a threshold µ||( f , g)|| as follows.
The random interval defined in (40), (42) and (43) using only the SV obtained by the GLR attack on the lattice E(V 1 , V 2 ) defined by (24) must be modified to include all the SVs with a norm less than the norm of the secret key, by threshold µ||( f , g)|. Hence, all vectors (F i , G i ) obtained in the course of GLR reduction that have norms: where N is the number of (F, G) pairs satisfying (44), µ is a threshold, e.g., µ = 10, and then, it must be checked that: If (45) is violated, i.e., one of the vectors in the list is our vector ( f , g), then another ( f , g) is used. Inequality (36) defines a range for r so that f , g, r, m meet (15). Now, the constraint on r is defined as follows: such that F j , G j , r, m violate (15) for any j = 1, ..., N. We require also that: Using (33) and (46), it is noticed that actually, the decryption correctness condition (15) for any j = 1, ..., N, is violated: From (33) and (46), it is also perceived that the decryption correctness condition (15) holds for the original ( f , g): Thus, Inequality (36) is used for f , but for r from (36) and (46): For RCPKC.2's security, the range defined by (50) shall be rather large, such as, e.g., max(α · 2 qlen/2 , rmin); hence, it is desirable to have: rmax ≥ 2 · max(α · 2 qlen/2 , rmin).
In order to provide CCA indistinguishability (see Definition 2 and Section 7), it is required to have: Thus, the RCPKC.2 proposal follows.
RCPKC.2 is more secure than RCPKC.1 because intermediate GLR outputs are also used for the random parameter range selection. However, their computational complexity is the same, since both employ GLR and follow the same encryption/decryption procedures.
RCPKC.2 is also resistant to various attacks, as shown in the security analysis presented in the next section. Note that hereafter, RCPKC.2 is again denoted as RCPKC.

RCPKC Security Analysis
In this section, attacks on NTRU are considered (brute force (on the key and message), meet-in-the-middle (MITM) in Section 6.1, lattice basis reduction in Section 6.4, hybrid lattice basis reduction and MITM [52] in Section 6.2, multiple transmission (MTA) [11] in Section 6.3, and also, the most recent, chosen ciphertext [53][54][55][56], in Section 6.5), and we try applying them to RCPKC. Herein, the NTRU parameters used, EES401EP1 [41], of the security level, k = 112 bits: In order to meet the same security level, the RCPKC settings satisfying (38) are: The key space cardinality (defined in Section 6.1 for the parameters (53) and (54)) is greater than or equal to 2 2·k for k =112 to avoid the MITM attack explained in Section 6.1.

Brute Force and MITM Attacks
An attacker can recover the NTRU private key by trying all possible values of g and testing whether f · h mod q has small coefficients (the product corresponds to g according to (10)). On the other hand, an attacker can try all possible values of g and test whether h −1 · g mod q (corresponding to f by virtue of (10)) has small coefficients. Equations (55) and (56) show the search space cardinalities for g and f for the security level, k = 112 (taking into account the MITM attack explained later in this section). The search space cardinality for f is computed as follows (see [53] (Section 7)): it is perceived the search space cardinality for f is less than that for g, so the best strategy for an attacker is to search for f values. An attacker can reduce the search space cardinality from 2 k to 2 k/2 [57] using MITM by splitting the private key f (which is a polynomial of degree N − 1) into two polynomials, f = f 1 + f 2 , where f 1 is a polynomial of degree at most N/2 − 1 and polynomial f 2 contains terms of degree between N/2 and N − 1, and then trying matches: f 1 · h mod q = (g − f 2 · h) mod q. Hence, in order to meet the k = 112 security level, the NTRU parameters must be chosen to meet the k = 224 security level, as it is already made in (53). For RCPKC, the secret value, g, is selected from the interval [2 mgLen−1 , 2 mgLen ) (see (33)); hence, the search space cardinality for g to meet the 2 · k-bit security level against the brute force attack shall satisfy: The secret value, f , is selected from the interval [α · 2 qLen/2 , 2 qLen−mgLen−1 ) (see (36)); hence, the search space cardinality for f to meet the 2 · k-bit security level against the brute force attack shall satisfy: For the parameters (54), C RCPKC (g, k) = 2 224 , while C RCPKC ( f , k) ≈ 2 247 . In order to provide the security level for k = 112, the parameters (54) are chosen to meet the twice greater security level of 2 · k = 224 to counter the MITM attack, considered below, which reduces the brute force attack effort by the square root. Since C RCPKC (g, k) < C RCPKC ( f , k), the best strategy for an attacker is to search for g values. Similar to NTRU, the MITM attack can be applied to the RCPKC private key component, g. Since mgLen is the bit length of g, then g = g 1 + 2 (mgLen−1)/2 g 2 , and then, g 1 and g 2 , each of a bit length equal to (mgLen − 1)/2, can be enumerated with the resulting search space cardinality O(2 (mgLen−1)/2 ) trying to find matching: Thus, the RCPKC parameters (54) provide the security level k = 112 against the brute force attack with MITM. Now, let us consider the brute force attack on the message.
An attacker can compromise an NTRU message by trying all possible values of r and testing whether e − r · h mod q has small coefficients. Similarly, the attacker can compromise the RCPKC message by trying all possible values of r and testing if e − r · h mod q ∈ [0, 2 mgLen−1 ) by virtue of (33).
The RCPKC message search space is defined by the interval [0, 2 mgLen−1 ) (see (33)); hence, the search space cardinality for m to meet the 2 · k-bit security level against the brute force attack shall satisfy: while the search space of r is defined by (46), (50) and (51). Hence, the search space cardinality for r to meet the 2 · k-bit security level against the brute force attack shall satisfy: Table 1 shows the mgLen and qLen values to meet different 2 · k-bit security levels' condition (60) (see Rows 1 and 2) and the width of the range for r (Row 7) with f and g specified in Rows 3 and 4, respectively. It proves that the method can be practically used. Table 1.
Width of the range for the r value for different security levels (Row 7); the parameters of the random congruential public key cryptosystem (RCPKC) affecting the width (mgLen, qLen, f , g, rmax, max(α · 2 qLen/2 , rmin)) are specified in Rows 1-6.

A Hybrid Lattice Basis Reduction and MITM Attack
The attack [52] on the NTRU secret key combines the LBRA and MITM strategies. The hybrid attack, first, splits the original lattice of order 2N, N > 1, into three subparts, only one of which is further reduced, whereas the vectors from the other parts are just enumerated, thus combining the concepts of the LBRA and MITM attacks. The hybrid attack is not applicable to RCPKC since: -The RCPKC lattice is two-dimensional and cannot be split into the three subparts; -RCPKC uses a large norm secret ( f , g) vector (see (33) and (36)) that cannot be found by LBRA looking for an SV, and the SV cannot be used for correct decryption (see (48)).

Multiple Transmission Attack
MTA reveals a large part of an NTRU message by sending n times one and the same message, m, using the same public key, h, but different random values, r i . For NTRU encryption (13) (see Section 3.1): e i = r i · h + m mod q for i = 1, 2, ..., n. An adversary computes: (e i − e 1 ) · h −1 mod q, thereby recovering r i − r 1 mod q, i = 1, ..., n, and from these relations, many coefficients of r 1 may be revealed. Knowledge of r 1 allows disclosing the message, m. RCPKC is not susceptible to MTA because no special structure is assumed for r 1 contrary to the case of NTRU.

Lattice Basis Reduction Attacks
The NTRU lattice basis, L NTRU h , associated with public key h defined in (1) is: where h 0 , ..., h N−1 are the coefficients of the polynomial h. For convenience, matrix L NTRU h is abbreviated as: The NTRU private key recovery problem can be formulated as the SVP in 2N-dimensional lattice, L NTRU h . Actually, if a polynomial, b, of degree N − 1 with integer coefficients satisfying: exists, then: Therefore, the vector ( f , g) is in the lattice L NTRU h . Vector ( f , g) or its rotation (rotation of a polynomial, f , by i steps is x i · f ∈ R q for an integer i) can be found if it is the shortest vector in L NTRU h . The lattice reduction algorithm LLL [51] finds the shortest vector in L NTRU h in time exponential in N. According to [40], LLL takes 1.05×10 31 MIPS (million instructions per second)-years to find the shortest vector or its rotation for N = 400 (as in (53)) that most likely is the NTRU private key part, ( f , g).
Contrary to NTRU, RCPKC is resistant to LBRA since the GLR attack fails for it (see Section 5). LBRA is one of the most used and effective techniques in attacking an NTRU private key (e.g., it is used in the hybrid lattice attack, the most efficient on practical NTRU parameters [58]; see Section 6.2), but it is not applicable to RCPKC.

Chosen Ciphertext Attack
Three chosen ciphertext attacks (CCA) on NTRU are known. The first key recovering CCA described in [54] uses a ciphertext of a special shape, which can be countered by message padding [53]. Standardized parameters [53] allow decryption failure, i.e., a ciphertext could fail to be decrypted correctly by NTRU. In [55], a CCA was presented where an attacker collects a large number of decryption failures; see the NTRU correction decryption condition (5) in Section 3.1. Another CCA was presented in [56], which is more efficient than [55], but still depends on decryption failures. RCPKC works on non-structured integers, and the parameters, set in Section 5, guarantee correct decryption. Thus, neither of the CCAs described above are applicable to RCPKC.

RCPKC Asymmetric Encryption Padding and its IND-CCA2 Security
In this section, we prove the security of the RCPKC one-way function based on the discussions of the security of the NTRU one-way function in [8], define RCPKC asymmetric encryption padding (RAEP), and prove its IND-CCA2 security as a particular case of NAEP. According to Sections 5.2 and 5.3, RCPKC defines the following four sets: The RCPKC encryption primitive is specified by the parameter set, P = (q, D f , D g , D m , D r ). The one-way function underlying RCPKC is: Definition 3. RCPKC-OW problem: For a parameter set, P, we denote by Succ OW RCPKC (A, P ) the success probability of a PPT adversary, A, for finding a pre-image of F h , .
Assumption 2. RCPKC-OW assumption: For every PPT adversary, A, solving the RCPKC-OW problem, there exists a negligible function, v A (k), such that for sufficiently large k, we have: An adversary A 1 can compromise (m, r) by picking r ∈ D r , substituting it in (e − r · h) mod q, and checking, if the result is in D m . Thus, Succ OW RCPKC (A 1 , P ) is: Since qLen > mgLen by definition (38), Succ OW RCPKC (A 1 , P ) decreases exponentially in qLen, and Assumption 1 holds. Similarly, the attacker can try the following methods with an exponentially decreasing success probability: 1. The adversary, A 2 , chooses randomly a pair (r ∈ D r , m ∈ D m ) and checks if r · h + m mod q = e. 2. The adversary, A 3 , picks f ∈ D f , substitutes it in f · h mod q, and checks whether the result is in D g . 3. The adversary, A 4 , chooses randomly a pair ( f ∈ D f , g ∈ D g ), if possible, calculates h , decrypts e to (r , m ), and checks if r · h + m mod q = e. 4. Furthermore, the adversary can apply the GLR attack to get ( f , g). However, by construction, RCPKC is immune to that attack, and hence, the success probability is zero. Therefore, Assumption 1 is true for all the above attacks.

RCPKC Performance Evaluation
Experiments were conducted using the NTRU code [59] and RCPKC implementation in the C99 language similar to [59] with the NTL library [60] on a PC equipped with 1.6 GHz Intel Core i5-8250U, 8 GB RAM, and Windows 10 (see Tables S1 and S2 of the Supplementary Material for the RCPKC performance experiments' results and the NTRU performance experiments' results, respectively; the RCPKC source code is available in [61]). Both the NTRU code [59] and the proposed RCPKC were implemented in Visual Studio 2017. The NTRU parameters (53) and the RCPKC parameters (54) were used. The CPU encryption and decryption time of RCPKC and NTRU was measured for 10 3 , 10 4 , and 10 5 runs. In each run, a distinct 128 bit message was encrypted/decrypted with both cryptosystems. The NTL function RandomLen() was used to pseudo-randomly generate the messages. RandomLen() was seeded with the output of the function clock(). The generated messages were stored in a separate file and used to test RCPKC and NTRU. The CPU time was measured via QueryPerformanceCounter() with ns accuracy. Table 2 shows the sample mean, x, standard deviation, σ, and confidence interval with the confidence level C ∈ {0.95, 0.99, .0.999} for the number of runs n ∈ {10 3 , 10 4 , 10 5 }, respectively for RCPKC and NTRU. The confidence interval, [l, u], is calculated using [62] (p. 358): , x i , and n are the sample mean, sample standard deviation, value of the run, and number of runs, respectively; z * is the critical value required for the specific confidence level; see Table C in [62] (p. 746). For example, in Table 2 for RCPKC encryption with C = 95%, n = 10 3 , x = 6.19 × 10 −6 , σ = 3.966 × 10 −6 , z * = 1.960, the confidence interval is calculated as follows: [l, u] = (6.190 × 10 −6 − 1.960(3.966 × 10 −6 )/ √ 1000, 6.190 × 10 −6 + 1.960(3.966 × 10 −6 )/ √ 1000) = (6.112 × 10 −6 , 6.267 × 10 −6 ). Figure 1 shows the NTRU/RCPKC encryption and decryption average CPU time ratio for 10 3 , 10 4 , and 10 5 runs. From Figure 1, it is observed that RCPKC is 27.08 ± 3.75 times faster than NTRU in encryption and 26.9 ± 5.09 times faster in decryption, respectively. Table 3 compares NTRU versus RCPKC and several NTRU variants presented in Section 1. It is observed that RCPKC is faster than the fastest most recently published NTRU variant, BQTRU, more than four times in encryption.

RCPKC Power Consumption Evaluation
In this section, RCPKC's power consumption is compared to NTRU in two cases: applying both algorithms using the same or different frequencies.
Same frequencies: Let the RCPKC and NTRU execution time be T RCPKC and T NTRU , respectively. Then, from (18), the consumed energy by NTRU and RCPKC E NTRU and E RCPKC is: Since T NTRU is greater than T RCPKC by more than 27 times, then from (62): From (63), RCPKC consumes twenty seven times less energy than NTRU using the same frequency. Different frequencies: Since RCPKC is 27 times faster than NTRU, the former takes approximately the same run time on a 27 times lower clock frequency CPU than that of the latter. Dynamic and leakage power consumption, calculated for frequencies from [48] (p. 19) according to (21), are shown in Table 4. It follows from Table 4 that P leak P dyn , and it can be neglected. From Table 4, it follows that reducing the clock frequency from 16 to 1 MHz leads to a 16 times power consumption reduction from 1440 to 90 µW. Note that MSP430FR5969, at a lower frequency, operates at a lower voltage: operating on a 1 MHz frequency at 2.2 V [48] (p. 19) results in 48.4 µW of dynamic power consumption.
Hence, the total power reduction is 1440 48.4 ≈ 30 times. Therefore, RCPKC, compared to NTRU, is better applicable to WSNs with power constrained devices.

Conclusions
In this paper, RCPKC is proposed, a secure and effective congruential, modulo q, public-key cryptosystem using big numbers. It uses the same encryption/decryption mechanism as NTRU does, but works with numbers. Contrary to NTRU, RCPKC is resistant to LBRA because its private key components, f and g, are chosen big with respect to √ q to form a two-component vector with the norm exceeding Minkowski's boundary (27)- (30) for the shortest vector in a two-dimensional lattice and meeting (31). Hence, LBRA by the GLR algorithm returning the shortest vector in a two-dimensional lattice fails at finding the large norm private key vector, ( f , g).
In spite of the big numbers, f and r, meeting (36) used in RCPKC, it guarantees that the decryption correctness condition (15) holds (see (39)) due to the use of Conditions (33), (36), (38), (46) and (50) instead of Conditions (7), (11), and (12), used in the original insecure CPKC (see Sections 3.3-3.3.2) considered in [26]. It was found that the insecurity of the original CPKC stems from the use of Conditions (7), (11) and (12), defining smaller than √ q numbers f , g, m, r meeting Minkowski's boundary (27) and the decryption correctness condition (15). RCPKC is resistant to the LBRA by GLR attack due to the special choice of the range for the random value, r, used in the encryption (13) that guarantees correctness condition (15) violation for the short vectors returned by GLR, but holding for the original private key, ( f , g). Section 6 shows also that the security of RCPKC with respect to other known attacks on NTRU is not less than that of NTRU, which allows us to conclude that RCPKC is more secure than NTRU. Section 7 proves the IND-CCA2 security of RCPKC asymmetric encryption padding (RAEP). RCPKC uses numbers, i.e., minimal possible, degree zero, polynomials, which makes it about 27 times more effective in encryption and decryption than NTRU and more than three times more effective in encryption with respect to the fastest most recently published NTRU variant, BQTRU [21], as the experiments show (see Table 3). Compared to NTRU, RCPKC reduces the energy consumption at least 27 times, which allows increasing the life-time of unattended WSNs by more than 27 times.
As a future work, the proposed RCPKC will be applied to telemedicine to secure the data collected by medical sensors and cameras.