# Secure Image Transmission Using Multilevel Chaotic Encryption and Video Steganography
## 4 The Proposed System
### Key Generation System  
The encryption keys are generated dynamically using a multilevel chaotic map. This method guarantees high unpredictability and robustness against brute-force attacks in contrast to traditional key generation techniques. The generated keys pass statistical randomness tests (NIST) to verify their security, as seen in Figure 1. It comprises three smaller systems. * System 1: Manages the first chaotic value production. * System 2: Increases the unpredictability of the chaotic values by applying further transformations. * System 3: Chooses which keys to utilize based on the outcomes of the preceding systems. It achieves higher randomness and unpredictability by mixing numerous chaotic maps and using a three-stage selection procedure. This process makes the generated keys extremely resistant to statistical and brute-force attacks. Before being embedded into video frames, the produced encryption keys help encode secret images after passing NIST randomness tests. * System 1 This part consists of five chaotic equations, as shown in Figure 2.  
* System 2 This part consists of two chaotic equations, as shown in Figure 3.  
Figure 2: System 1. The following are the system outputs: Output 1. Decimals \(X\) and \(Y\), where \(0<X\), \(Y<1\). Output 2. Decimal \(X\), where \(0\leq X\leq 1\). Output 3. Decimals \(X\) and \(Y\), where \(-1<X\), \(Y<1\). Output 4. Decimals \(X\) and \(Y\), where \(-10<X\), \(Y<10\). Output 5. Decimals \(p\) and theta, where \(0<p<7\) and \(1<\) theta \(<6\). The output from System 1 is converted to binary with the following condition: def check_value (value, comparison): global ones, zeros, bit_key; if value \(>=\) comparison: bit_key \(+=\) “1”; ones \(+=1\); else: bit_key \(+=\) “0”; zeros \(+=1\), where “value” is the input value (the result of a chaotic equation), and “comparison” is a reference (comparison) value used to determine whether a value is larger or smaller. Here, five bytes are acquired in each move. * System 3 System 3  
System 3 consists of one chaotic equation, as shown in Figure 4.  
The output of this part of the system acts as a control between the two systems. If the output is greater than or equal to 0.5, the key generated is taken from System 1, and if the output is less than 0.5, the key generated is taken from System 2. Converting the chaotic outputs into a binary sequence is a key process in our cryptosystem, which directly generates the encryption keys of the AES algorithm. For each real-valued output of the chaotic maps, it is decided whether or not to map it to a '0' or a '1' by comparing it with a reference threshold. This binarizing process turns continuous chaotic behavior into discrete key material. The value of this threshold was not chosen arbitrarily but empirically, after trying the methodology over a series of experiments in each chaotic map. The objective was to have approximately the same number of 0 s and 1 s in the output bitstream that will maximize the entropy and cause the produced keys to pass the NIST randomness tests successfully. Without loss of generality, in our implementation, we take this threshold to be the middle (or mean) of the anticipated chaotic range (for example, 0.5 for maps in [0, 1] and 0 for maps in [-1, 1]) and hence obtain unbiased binary output. The resulting binary stream is divided into 256-bit blocks used as AES keys. The bidirectional partitioned bit-level rounding produces high entropy, uniformity, and key invariability necessary for strong cryptographic resistance. These sequences are the encryption keys compatible with typical cryptographic schemes. Next, they are subjected to a selection process using the NIST statistical package to verify randomness and ensure the strength of the generated key. The image is ready to be encrypted using the AES algorithm after it is divided into a set of subkeys with a length of 256 bits. The proposed system employs eight chaotic maps distributed across three subsystems to enhance key generation complexity.