## 3 The Proposed Model
### Optimal Key Generation Process  
To optimally choose the keys related to the FHE technique, the SCA is exploited in this work. [PERSON] introduced an SCA based on the population-based optimization  
Figure 1: Workflow of FHEOKG-SGC algorithm.  
technique [23]. The SCA produces the initial choice and enables it to alter towards a better solution by applying \(sin\) and \(cos\) functions.  
The optimization-based algorithm was separated into exploration and exploitation stages. Two stages of exploration and exploitation are defined as follows:  
\[X_{i}^{t+1}=X_{i}^{t}+r_{1}*\sin(r_{2})*\big{|}r_{3}*P-X_{i}^{t}\big{|}, \tag{2}\]  
\[X_{i}^{t+1}=X_{i}^{t}+r_{1}*\cos(r_{2})*\big{|}r_{3}*P-X_{i}^{t}\big{|}. \tag{3}\]  
Combine Equations (2) and (3) by using the following expression:  
\[X_{i}^{t+1}=\left\{\frac{X_{i}^{t}+r_{1}*\sin(r_{2})*\big{|}r_{3}*P-X_{i}^{t} \big{|};r_{4}\leq 0.5}{X_{i}^{t}+r_{1}*\cos(r_{2})*\big{|}r_{3}*P-X_{i}^{t} \big{|};r_{4}\geq 0.5},\right. \tag{4}\]  
In Equation (4), \(r_{4}\) refers to the random integer within \([0,1]\).  
The key variables in Equations (2)-(4) are \(r_{1},r_{2},r_{3}\), and \(r_{4}\).  
1. \(r_{1}\) determines the direction within the space among the solution and the space outside the solution or the destination.
2. \(r_{2}\) gives the distance to travel toward or outward from the target.
3. \(r_{3}\) shows random weight to highlight the weight of exploitation (\(r_{3}<1\)) or exploration (\(r_{3}>1\)).  
The effects of \(\sin\) and \(\cos\) in Equations (2) and (3) determined the spatial region among 2 solutions from the search range. The cyclic model of \(\sin\) and \(\cos\) functions enables relocating around the different solutions. Moreover, to prevent local optimization, solutions should be explored outside the space among the destination and solutions.  
The effects of \(\sin\) and \(\cos\) functions are within \((-2,2)\). Changing the scope of \(\sin\) and \(\cos\) functions would result in one solution that itself changes the location of the solutions with one another. Figure 2 demonstrates the steps included in the SCA.  
For a better algorithm, a balance of the two stages of exploitation and exploration is needed to discover potential areas of searching space to reach the global optimizer.  
For the SCA, to balance both exploitation and exploration, the scope of \(\sin\) and \(\cos\) functions in Equations (2)-(4) is changed as follows:  
\[r_{1}=a-t\frac{a}{T}, \tag{5}\]  
where \(t\) refers to the existing iteration, \(T\) signifies the maximal iteration counts, and \(a\) represents the constant. The above equation decreases the scope of \(sin\) and \(cos\) functions over iterations. It should be noted that the SCA explores the search range once the \(\sin\) and \(\cos\) functions range within (1, 2] and [\(-2,\,-1\)). However, this method uses the searching space once the range is within (\(-1,\,1\)).  
The SCA process begins the optimizer with a series of random solutions. This technique stores the better solution, allocates it as the destination, and upgrades other solutions. In the meantime, the scope of \(\sin\) and \(\cos\) functions are upgraded to emphasize the exploitation of the search range as the iteration count rises. The SCA technique ends the optimizer technique once the iteration count becomes greater than the maximal number of iterations. The ending criteria are regarded as the accuracy of the global optimum or evaluation of the maximal amount of function.