## 4 Organizational Experimental Setup
### Loss Function  
In the rapidly evolving landscape of cryptography, the integration of adversarial methodologies, inspired by Generative Adversarial Networks (GANs), introduces a paradigm shift in ensuring secure communication. At the heart of this transformation lies the loss function, an essential tool to gauge and guide the performance of cryptographic models. Within the GAN framework, the loss function serves as a battlefield where two entities, the generator and the discriminator, contest their strengths and weaknesses. Translating this to the cryptographic domain, [PERSON]'s encryption and [PERSON]'s decryption processes are the adversarial counterparts, with [PERSON] acting as a neutral evaluator of [PERSON]'s success. The loss function's role in GAN Cryptography transcends traditional metrics. It is the pivot around which the security dynamics revolve, guiding the cryptographic models to their optimal performance and ensuring robust, secure communication in an adversarial setting  
We denote \(A(m,\ k)\) as [PERSON]'s encryption function on input message \(m\) and key \(k\), and \(B(c,\ k)\) as [PERSON]'s decryption function on input ciphertext \(c\) and key \(k\). Similarly, we write \(E(c)\) for [PERSON]'s decryption function on input \(c\).  
We use a loss function L on decrypted messages [17]. We also use the mean absolute error (L1 distance) for this function defined in Equation (1):  
\[L\big{(}m,m^{\prime}\big{)}=\frac{1}{N}{\sum_{i=1}^{N}}|m_{i}-m_{i}^{\prime}| \tag{1}\]  
where \(N\) is the length of the message.  
Loss functions for [PERSON] and [PERSON] and for [PERSON] are then defined as in Equation (2):  
* [PERSON] and [PERSON]'s loss: \[L_{AB}(m,k)=L(m,B(A(m,k),k))\] (2) Intuitively, this represents the error in [PERSON]'s decryption of the message encrypted by [PERSON]. The goal for [PERSON] and [PERSON] is to minimize this loss.
* [PERSON]'s loss: \[L_{E}(m,k)=L(m,E(A(m,k)))\] (3) This represents the error in [PERSON]'s decryption of the message encrypted by [PERSON]. The goal for [PERSON] is also to minimize this loss, unlike in some cryptographic settings where [PERSON] and [PERSON] would try to maximize [PERSON]'s error as defined in Equation (3).  
The \"optimal\" [PERSON] and [PERSON] are obtained by minimizing the loss \(L_{AB}\) with respect to the parameters of [PERSON]'s and [PERSON]'s models as defined in Equation (4):  
\[(OA,OB)=\arg min_{m,k}(L_{AB}(m,k)) \tag{4}\]  
Similarly, the \"optimal\" [PERSON] is obtained by minimizing the loss \(L_{E}\) with respect to the parameters of [PERSON]'s model as defined in Equation (5):  
\[OE=\arg min_{m,k}(L_{E}(m,k)) \tag{5}\]  
The training process consists of alternating updates to [PERSON] and [PERSON]'s parameters to minimize \(L_{AB}\) and to [PERSON]'s parameters to minimize \(L_{E}\). This process starts with random initializations for [PERSON], [PERSON], and [PERSON], and iteratively moves towards the optimal solutions (or close to them).  
While the detailed theoretical framework might involve additional complexities, such as adversarial relationships between the parties, this code implements a more straightforward optimization of the two separate loss functions. Both [PERSON] and [PERSON], and [PERSON], are independently trying to minimize their respective errors.