## 3 Design
### Layered Key Initialization and Data Partitioning  
Figure 3 shows the procedure for secure key initialization and offset-aware file partitioning prior to distributed encryption. Our proposed scheme starts with generating a symmetric AES key. _AES Generator_ creates a random 256-bit key [76,77] (). Then, _PQC Generator_ performs key-pair generation using Kyber. A public key and a secret key are created. The AES key is encapsulated using the PQC public key, resulting in a PQC ciphertext. This encapsulated ciphertext enables the AES key to be securely transferred to each slave node without revealing its plaintext. The PQC ciphertext is included in the metadata sent to each slave, while the corresponding PQC secret key is securely retained at the master in protected form for later AES key recovery. To prevent leakage of the PQC secret key during transmission, _QKD Generator_ runs a BB84-based protocol to generate a QKD session key. QKD session key is used to XOR-mask the PQC secret key before transmitting it. Masked secret key can be recovered only by a slave that holds the same QKD session key. Even if intercepted, the masked secret key remains secure, as it cannot be used without the corresponding QKD session key. For fault tolerance and resilience against node failure, the masked secret key is optionally split into multiple fragments using [PERSON]'s \((t,n)\) secret sharing scheme. These fragments are distributed to \(n\) slaves, such that any \(t\) of them can later reconstruct the original masked key (). Although all slaves receive a fragment and reconstruct the masked secret key to perform AES encryption, only a designated subset of \(t\) nodes is authorized to retain the reconstructed key beyond the encryption phase. The remaining slaves discard the key immediately after encryption, preventing long-term exposure even under partial compromise. This strategy enables fault-tolerant key recovery while preserving post-execution confidentiality. After key encapsulation and masking, the master sends the PQC ciphertext and the masked secret key to each slave. This is because the secret key is never exposed in plaintext and is recoverable only through QKD-protected masking. Our scheme maintains confidentiality even during key distribution. These cryptographic components are delivered before file partitioning begins, enabling each slave to focus solely on subset-level encryption without participating in key generation or coordination ().  
Once key transmission is complete, _Cipher Dispatcher_ performs data preparation and partitioning for parallel encryption. The target file is first converted into binary, and its total size is measured. Based on the number of participating slave nodes, the master computes logical start and end offsets for each node, effectively dividing the file into  
Figure 3: Layered key initialization and offset-aware partitioning for distributed encryption.  
disjoint byte-range regions. These regions are designed to support concurrent access by slave nodes during subset-level encryption without overlap or contention. Following offset computation, the file is conceptually divided into fixed-size subsets (e.g., 4, 8, and 16 MB), and the total number of subsets is determined from the file size and subset configuration. The resulting subset layout defines the unit of encryption and completes the preparation phase for distributed execution (). Once offset ranges are defined and the file is segmented into fixed-size subsets, each slave receives its designated offset information for file access. During encryption, each slave reads the file from the assigned offset range in a streaming manner, processing the data in fixed-size subsets. For each subset, the AES key is locally reconstructed by decapsulating the received PQC ciphertext using the masked secret key. The reconstructed AES key is then used to encrypt each subset in CTR mode, and the resulting encrypted subsets are prepared for transmission to the master node ().