Network coding (NC) has frequently been promoted as a means of improving throughput in wireless networks. Existing work has mostly focused on the fundamental aspects of NC, while constraints arising from real-world network deployments have not been given much attention. In particular, NC requires network nodes to overhear each other's packets, which is oftentimes in contradiction to many security standards that attempt to provide link-layer confidentiality by using, e.g., pairwise encryption keys (such as IEEE 802.11i or ZigBee). Therefore, there is an inherent trade-off in using NC and applying link-layer security: if many nodes share the secret link-layer key, NC will improve the network throughput, yet a leakage of the key will affect many nodes; on the other hand, having distinct secret keys will increase the network resilience against key compromise, but it will also minimize the coding gain. We formulate this security vs. performance trade-off as an optimization problem and evaluate the effectiveness of NC under different sizes of key-sharing groups and network topologies. Our results show that increasing the key-sharing group by a single node can result in a maximum coding gain between 1.3% and 13.7%.