TinyOS layer for configurable protection of message privacy and intrusion detection