# Application of Terminal Audio Mixing in Multi-Bandwidth End-to-End Encrypted Voice Conference +
## 3 Terminal-Side Mixing Technology  
The homomorphic encryption method requires encrypting the original voice data to transmit the ciphertext to the server using homomorphic addition to directly mix the encrypted voice data on the server. The mixed result is then sent back to each mobile terminal for decryption and playback. Although this algorithm mixes encrypted voice data without a need to decrypt these on the server, it necessitates the transmission of the original voice data, which imposes a heavy burden on the mobile CPU and requires significant time for encryption and decryption. Additionally, the large amount of data processing reduces the audio sampling rate. During a meeting, all terminals must re-exchange keys to add a \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Key Length (Bits)** & **Plaintext Length (Bytes)** & **Per-Unit Encryption Time** & **Measured Transmission** \\  & **Network Reception** & **(ms)** & **Bitrate (Kbps)** \\ \hline
256 & 32 & 16.12 & 15.9 \\
512 & 64 & 16.34 & 36.8 \\
1024 & 128 & 31.97 & 26.3 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Actual transmission bitrate of homomorphic encryption. new member, which disrupts the meeting. In contrast, end-to-end encryption technology combined with terminal-side mixing technology allows the mobile terminal to encode the voice data to reduce its size before mixing and encrypting the encoded voice data. The ciphertext is then transmitted to the server, which forwards it to each mobile terminal for decryption and playback (Figure 3). This method secures communications for all terminals through end-to-end encryption and adjusts the mixing process, which originally required decryption on the server to the mobile terminal (Figure 4). Voice data are transmitted using different encoding methods depending on the network environment (Figure 5), enabling satellite calls even in the absence of mobile networks and Wi-Fi. Since each mobile terminal and the conference-initiating terminal have different keys (Figure 6), only the new member needs to perform the key exchange when joining a meeting in progress. This approach effectively handles and improves the issues arising from homomorphic encryption in group calls, creating a superior end-to-end group call environment. Figure 4: Mixing on terminal. Figure 5: Independent stream encoding. The encrypted conference using terminal-side mixing technology is conducted in two stages. The first stage is the key exchange for end-to-end encryption, and the second stage is the encrypted voice conference with terminal-side mixing. In the key exchange stage, each terminal conducts key exchange with the conference-initiating terminal using the EC Diffie-Hellman (ECDH/DH) algorithm to obtain its independent encryption key. Since these encryption keys are independent, if a new member needs to join the meeting in progress, the new member only needs to perform a key exchange with the conference-initiating terminal, ensuring that the ongoing meeting is not disrupted. In the encrypted voice conference with terminal-side mixing, the voice data collected by each terminal are encoded and compressed. The choice of encoding depends on the network environment. For example, Lyra delivers high-quality audio with low bandwidth in an environment with poor network conditions [3]. G.711 offers low latency and low loss in VoIP environments [4] and can be used in traditional telephony, while Opus provides excellent sound quality, stereo sound, wide bandwidth support, and low latency [5, 6]. The encoded voice data are encrypted using the keys obtained during the key exchange stage, transmitted via user datagram protocol/real-time transport protocol (UDP/RTP) packets, and forwarded by the server to the conference-initiating terminal for decryption and mixing. The conference-initiating terminal then re-encrypts the mixed voice data according to each terminal's encryption key and forwards these to each terminal via the server for decryption and playback.