## 3 Methodology
### Development of Hybrid Encryption Technique  
The hybrid encryption technique is accomplished by developing an encryption algorithm that uses multiple levels of encryption and decryption. Specifically, text data are encrypted in two steps. The initial encryption uses a GA-based technique, followed by a second layer of encryption utilizing the RSA algorithm, as shown in Figure 2.  
GA-Based Encryption: Initially, a random set of keys is generated. Each key will be assessed by encoding and decoding the original message using the XOR function. The fitness criteria for generating a symmetric encryption key include a multi-objective function to balance three major parameters, viz., encoded message length and XOR efficiency, randomness in ciphertext, and key diversity. Keys generated with uniqueness over encryption sessions or packets are rewarded. This prevents the reuse of keys, enhanced forward secrecy, and ensures that if one key is compromised, the other sessions remain secure. In addition, the fitness function verifies that the keys produce ciphertext with a high degree of randomness, which is assessed by minimizing the correlation between the plaintext and ciphertext. While these functions remain a part of the fitness criteria, the selection of keys only occurs once lossless decoding criteria are satisfied. Each key is evaluated based on its ability to encode and decode the original message using the XOR function, thereby maintaining strong obfuscation through XOR operations. The goal is to minimize the length of the encoded message while retaining the true decryption. The sequential process performed over multiple generations of selection, crossover, and mutation organizes the population to find the best key. The key for encoding the message is cryptographic and is further secured by RSA encryption, thus providing extra security. This ensures confidentiality even if the XOR key is compromised, as presented in Algorithm 1 and shown in Figure 2.  
Figure 1: Processes for implementation and evaluation of encryption as policy established through Mininet with POX controller. ```
1:Initialization:
2: Define population size \(n\). 3: Generate a random population of potential keys population \(=\{k_{1},k_{2},\ldots,k_{n}\}\) where \(k_{i}\in\{0,1,\ldots,255\}\). 4:Evaluation:
5:for each key \(k_{i}\) in the population do
6: Encode and decode the original message \(M\) using XOR with \(k_{i}\). 7: Calculate fitness score \(f(k_{i})=\sum_{j=1}^{m}\delta(M[j],D(E(M,k_{i}),k_{i})[j])\), where: \(M\) is the original message of length \(m\) bytes. \(E(M,k_{i})\) is the encoded message using XOR with key \(k_{i}\). \(D(E,k_{i})\) is the decoded message using XOR with key \(k_{i}\). \(\delta(a,b)\) is the Kronecker delta, which is 1 if \(a=b\) and 0 otherwise. 8:endfor
9:Selection:
10: Calculate the probability of selection \(P(k_{i})=\frac{f(k_{i})}{\sum_{j=1}^{m}f(k_{j})}\). 11: Select parents \(k_{\text{parent1}}\) and \(k_{\text{parent2}}\) based on probabilities \(P(k_{i})\). 12:Reproduction (Mating):
13: Perform crossover to generate offspring: \(c\) is a random crossover point within the length of the keys. \(k_{\text{child}}=(k_{\text{parent}}[:c]+k_{\text{parent2}}[c:])\). 14:Mutation:
15:for each gene \(j\) in \(k_{\text{child}}\)do
16: Mutate gene with probability \(p_{m}\): \[k_{\text{mutated\_child}}[j]= \begin{cases}\text{random}(0,255)&\text{with probability }p_{m}\\ k_{\text{child}}[j]&\text{with probability }1-p_{m}\end{cases} .\]
17:endfor
18:Iteration:
19: Repeat the steps of evaluation, selection, reproduction, and mutation for \(G\) generations. 20:Convergence:
21: Select the best key \(k_{\text{best}}\) after \(G\) generations: \(k_{\text{best}}=\arg\max_{k_{i}\in\text{population}}f(k_{i})\). ```  
**Algorithm 1** Genetic algorithm-based encryption process. For this application, genetic operators are parameterized to key generation for secure and efficient encryption.