In this paper, we present our implementation of a stateful public key encryption (stateful PKE) scheme in the wireless sensor network (WSN) environment. In order to reduce the communication overhead of the stateful PKE scheme we implement, which is of prime importance in WSN, we introduce a technique called "indexing". The performance analysis of our implementation shows that there are significant advantages of using stateful PKE in WSN in terms of computation and communication costs, compared with normal public key encryption.