Wireless sensor networks (WSN) behave as a digital skin, providing a virtual layer where the information about the physical world can be accessed by any computational system. As a result, they are an invaluable resource for realizing the vision of the Internet of Things (IoT). Many applications of sensor networks require secure communication. Thus establishing a secure channel between any two sensor-nodes in WSNs/IESNs is important for many applications, such as secure data exchange, secure data aggregation, and secure routing. In this paper, first we show why existing three party key establishment schemes cannot be easily applied to IESN. Second we propose an extension of traditional three-party key establishment schemes (such as SNEP, BBF and OR). The method provides DoS and Sybil attack resistance and benefits from low communication cost, independence of prior sensor deployment knowledge and support for node mobility. In comparison to the previous well-known three-party schemes, our extension not only fixes DoS vulnerability, but also provides some other advantages such as significant efficiency. The proposed key establishment scheme can be used not only for establishing shared key between any two sensors, but it is applicable for establishing shared secret between any two entities/ things in the context of IoT.