This paper introduces the method secure-by-design as a way of constructing wireless embedded systems using component-based modeling frameworks. This facilitates design of secure applications through verified, reusable software. Following this method we propose a security framework with a secure communication component for distributed wireless embedded devices. The components communicate using the Secure Embedded Exchange Protocol (SEEP), which has been designed for flexible trust establishment so that small, resource-constrained, wireless embedded systems are able to communicate short command messages, with full support for confidentiality, authentication, and integrity using keypairs. The approach has been demonstrated in a multiplatform home automation prototype that can remotely unlock a door using a PDA over the Internet. Keywords communication system security, protocols, software reusability, wireless security, embedded systems