## 3 Methodology
### NTRUEncrypt Cryptography  
Conventional algorithms, such as RSA and ECC, are not appropriate for the IoT environment; the reason lies in the complexities of encryption and decryption operations. Compared to these algorithms, NTRUEncrypt is efficient in terms of speed, detection accuracy, and security level [49]. In NTRU, polynomial executions in the ring are simple, making it faster. The \"\(N\)th-Degree truncated polynomial ring unit\" (NTRU) is a lattice-based public key cryptographic technique that uses the algebraic structure of the polynomial ring \"\(\mathcal{R}\)\" [50]. \"\(\mathcal{R}\)\" is the ring of convolution or (truncated) polynomials with degree \"\(N-1\)\", with integer coefficients in the form of \(a_{0}+a_{1}X+a_{2}X^{2}+\ldots+a_{N-2}X^{N-2}+a_{N-1}X^{N-1}\). Here, \(a_{N}\) denotes coefficients of the polynomial, depending on the NTRUEncrypt variant being used. The coefficients are usually binary (0 or 1) or trinary (\(-1\), 0, or 1). \(X\) represents the variable of the polynomial.  
\"\(\mathcal{R}\)\" can be defined as [50]:  
\[R=\bigg{(}\frac{\mathbb{Z}[X]}{(X^{N}-1)}\bigg{)}. \tag{1}\]  
Figure 8: Network model of the NBMS.  
With the modulo \"\(p\)\" and \"\(q\)\", the ring \"\(\mathcal{R}\)\" can be written as \[R_{p}=\frac{(\mathbb{Z}/\,p\mathbb{Z})[X]}{(X^{N}-1)}\quad\text{and}\quad R_{q} =\frac{(\mathbb{Z}/\,q\mathbb{Z})[X]}{(X^{N}-1)}.\] (2) The following parameters characterize the implementation of NTRUEncrypt: * \(N\): Degree Parameter. * \(D_{f},D_{g}\): Spaces for private keys (private keys are chosen from these sets of small polynomials). * \(p,q\): Small and large moduli. * \(D_{m}\): Space for plaintext (set of polynomials representing encryptable messages). * \(D_{r}\): Space for the blinding value (the temporary blinding value used for encryption from this set of polynomials). * Center: Centering method (performs mod '\(q\)' reduction during decryption). Key creation: * Generate polynomials \(g\) and \(f\) randomly in \(D_{g}\) and \(D_{f}\). * Take the inverse of \(f\) in \(R_{p}\) to obtain \(f_{p}\), and the inverse of \(f\) in \(R_{q}\) to obtain \(f_{q}\), making sure that \(g\) is invertible in \(R_{q}\). * Create \((f,f_{p})\) as the private key and \(h=p*g*f_{q}\,(\bmod q)\) as the public key. Encryption: * Choose a small polynomial randomly, such that \(r\in D_{r}\). * Compute \(e=r*h+m\,(\bmod q)\), called ciphertext. * Compute \(a=\text{center}(f*e)\), where the center decreases its input into the interval \([B,B+q-1]\). * Retrieve \(m\) by computing \(m=f_{p}*a\,(\bmod p)\), where \(a=p*r*g+f*m\,(\bmod q)\), using \(h=p*g*f_{q}\) and \(e=r*h+m\). Hence, after suitable choices of parameters and the centering operation, the term \(p*r*g\) disappears and \(f_{p}*f*m=m\,(\bmod p)\). NTRUEncrypt cryptography helps provide the secure encryption and decryption of data. It can resist different types of attacks, including cryptanalytic attacks, factorization attacks, brute-force attacks, chosen-ciphertext attacks, quantum computing attacks, and timing attacks [50]. Conversely, a combination of NTRUEncrypt cryptography and the AODV routing protocol can tackle various attacks, such as DoS attacks, rushing attacks, routing table overflow attacks, false data injection attacks, black hole attacks, wormhole attacks, Sybil attacks, man-in-the-middle attacks, spoofing attacks, replay attacks, key management attacks, and side-channel attacks.