Despite much research effort key distribution in Wireless Sensor Networks (WSNs) still remains an open problem. In this paper we address this issue by proposing a simple identity- based key agreement scheme. Our protocol uses Identity-Based Cryptography (IBC) and secret key pre-distribution. We argue that IBC is in many ways a perfect solution for WSNs. It reduces the number of required keys, simplifying the key management in the network, and has a lower communications overhead than traditional public key protocols. We evaluate our proposal on a broad range of sensor platforms to show its efficiency on different CPU architectures. A complete key agreement procedure takes less than 3s on a resource- constrained Tmote Sky node without requiring any communication between two parties. To our knowledge this work is the first practical implementation of a complete IBC scheme on sensor devices. We identify a range of WSN applications which would benefit from the incorporation of a security architecture, and show that the scheme described here makes it feasible to deploy these applications in the real world.