In this paper, we approach the design of energy- and security-critical distributed real-time embedded systems from the early mapping and scheduling phases. Modern Distributed Embedded Systems (DESs) are common to be connected to external networks, which is beneficial for various purposes, but also opens up the gate for potential security attacks. However, security protections in DESs result in significant time and energy overhead. In this work, we focus on the problem of providing the best confidentiality protection of internal communication in DESs under time and energy constraints. The complexity of finding the optimal solution grows exponentially as problem size grows. Therefore, we propose an efficient genetic algorithm based heuristic for solving the problem. Extensive experiments demonstrate the efficiency of the proposed technique.