## 3 The Methodology
### Secure Credentials (SCs)-Based Authentication
The final calculation of the softmax layer is defined as follows:  
\[S^{i}=\frac{\exp\left(Y_{i}\right)}{\sum\
olimits_{j}^{5}\exp\left(Y_{j} \right)} \tag{14}\]  
Finally, the softmax layer provides the encrypted data packets. The pseudocode describes the encryption process using the Twine-LiteNet algorithm. It encrypts the data packets (D_P) using the TWINE algorithm; then, a fully connected layer (Lite module) is applied to produce the encrypted data (E_D). Figure 5 shows the representation of the flowchart. Later, the optimum route is selected among CHs using four factors: available bandwidth, link quality, residual energy, and path duration. It is selected by the SRO algorithm, and its performance is high when it is compared with other optimization algorithms. Figure 5: LiteNet with Twine Mode. Single-Objective Optimization (SRO) is chosen for route optimization to focus on optimizing a specific objective, such as minimizing travel distance or reducing delivery time, without considering the conflicting objectives. The motivation behind using SRO algorithms is to simplify the optimization process by reducing the problem to a single objective, by making it easier to find an optimal solution within limited computational time. The optimal route is computed by the SRO algorithm. When compared with other optimization algorithms, its performance is high, due to the adoption of clue-based exploration. The clue matrix is formulated, and it consists of route selection attributes and available routes. This can be represented as  
\[H= \begin{bmatrix}A\\ R\end{bmatrix} = \begin{bmatrix}A_{11}&\cdots&A_{1D}\\ \vdots&\ddots&\vdots\\ A_{N1}&\ldots&A_{ND}\\ R_{11}&\cdots&R_{1D}\\ \vdots&\ddots&\vdots\\ R_{N1}&\cdots&R_{ND}\end{bmatrix}  \tag{15}\]  
where \(A\) and \(R\) denote the attribute and available routes, respectively. The search direction of the route considering the attributes is expressed as  
\[JD_{x}=\left(A_{x}-R_{y}\right),\ x\
eq y \tag{16}\]  
where \(JD_{x}\) denotes the direction of the search for the \(x^{th}\) route, and \(A_{x}\)& \(R_{y}\) denote the \(x^{th}\) route position and \(y^{th}\) attribute position, respectively. To diversify the change directions to search for a route repeatedly, the binomial crossover mechanism is adopted, and it can be represented as  
\[A^{\prime}_{x,k}= \begin{cases}H_{y,k}+v1\times\left(A_{x,k}-H_{y,k}\right),\ \text{if}\ \text{of}\left(H_{y}\right)>\text{of}\left(A_{x}\right)\\ A_{x,k}+v1\times\left(A_{x,k}-H_{y,k}\right),\ \text{if}\ k=k_{rand}\\ A_{x,k},\ \text{otherwise}\end{cases}  \tag{17}\]  
where \(A^{\prime}_{x,k}\) denotes the new position of the \(k^{th}\) dimension of the \(x^{th}\) route. \(H_{y,k}\) represents the position of the \(k^{th}\) dimension of the \(y^{th}\) attribute. \(\text{of}\left(H_{y}\right)\) and \(\text{of}\left(A_{x}\right)\) represent the objective functions for \(H_{y}\) and \(A_{x}\), respectively. Let \(v1\) denote a random number between 0 and 1. The new position of \(x^{th}\) route can be formulated as  
\[A^{\prime}_{x}=A_{x}+v2\times\left(H_{y}-H_{r}\right),\ x\
eq y\
eq r \tag{18}\]  
If \(v2\) is a random number from 0 to 1, then the following holds. The boundary conditions are calculated such that the new location is optimal, and they may be expressed as  
\[A^{\prime}_{x,k}= \begin{cases}\frac{A_{x,k}+A_{k}^{max}}{2},\ \text{if}\ A^{\prime}_{x,k}>A_{k}^{max}\\ \frac{A_{x,k}+A_{k}^{min}}{2},\ \text{if}\ A^{\prime}_{x,k}>A_{k}^{min},\ k=1,2,..D \end{cases}  \tag{19}\]  
where \(A_{k}^{max}\) and \(A_{k}^{min}\) denote the upper and lower boundaries of the \(k^{th}\) dimension. The above equations are used to search the route in each iteration and the change of the previous position to the new position is stored in the matrix R which can be formulated as,  
\[R_{n}=\left\{\begin{array}{l}A_{x},\ \text{if}\ \text{of}\left(A^{\prime}_{x} \right)>\text{of}\left(A_{x}\right)\\ R_{n}\