Symmetric encryption is the most commonly employed security solution in wireless sensor networks (WSNs). In this paper, a new approach that employs public-key cryptography during key establishment is proposed. In a WSN, the main issue for public-key cryptography is represented by communication and computational overheads. In order to reduce these requirements, a new authentication system based on authentication tables is proposed. An analytical study shows that the proposed approach provided optimal protection against an adversary that compromised one or more nodes. A comparative analysis shows that, according to the dimension and the density of the network, the proposed approach can represent the best solution. Furthermore, an experimental analysis conducted on a real network shows that the proposed approach can be successfully applied to devices with limited computational power.