A method of operating a computer system to provide secure communications, the computer system comprising a plurality of host devices (170A, 170B) interconnected by a network and organized into a plurality of enclaves, and comprises a plurality of intermediary devices (360, 362, 364) connected in a network path between a first host device in a first enclave of the plurality of enclaves and a second host device in a second enclave of the plurality of enclaves and the method comprising: establishing a security association between the first host device and the second host device, the establishing comprising: sending, by the first host device, a control packet to the second host device, said control packet including a first information element inserted by the first host device; responding, by the second host device, with a second control packet including one or more second information elements (330, 332, 334), each inserted by one of the intermediary devices that process the second control packet as it is routed through the network from the second host device to the first host device, wherein the second information elements (330, 332, 334) indicate the enclaves in which the respective intermediary device is located; generating, by the first host device, a security association key for communicating with the second host device, the generating comprising: determining, by the first host device, the enclaves at the beginning and end of a path indicated by the second information elements, and selecting a pair-wise key corresponding to the determined enclaves for generating the security association key; communicating one or more packets in accordance with the established security association between the first host device and the second host device, wherein a cryptographic function is performed on one or more of the packets using the generated security association key. establishing a security association between the first host device and the second host device, the establishing comprising: sending, by the first host device, a control packet to the second host device, said control packet including a first information element inserted by the first host device; responding, by the second host device, with a second control packet including one or more second information elements (330, 332, 334), each inserted by one of the intermediary devices that process the second control packet as it is routed through the network from the second host device to the first host device, wherein the second information elements (330, 332, 334) indicate the enclaves in which the respective intermediary device is located; generating, by the first host device, a security association key for communicating with the second host device, the generating comprising: determining, by the first host device, the enclaves at the beginning and end of a path indicated by the second information elements, and selecting a pair-wise key corresponding to the determined enclaves for generating the security association key; sending, by the first host device, a control packet to the second host device, said control packet including a first information element inserted by the first host device; responding, by the second host device, with a second control packet including one or more second information elements (330, 332, 334), each inserted by one of the intermediary devices that process the second control packet as it is routed through the network from the second host device to the first host device, wherein the second information elements (330, 332, 334) indicate the enclaves in which the respective intermediary device is located; generating, by the first host device, a security association key for communicating with the second host device, the generating comprising: determining, by the first host device, the enclaves at the beginning and end of a path indicated by the second information elements, and selecting a pair-wise key corresponding to the determined enclaves for generating the security association key; communicating one or more packets in accordance with the established security association between the first host device and the second host device, wherein a cryptographic function is performed on one or more of the packets using the generated security association key.