A Wireless Sensor Network (WSN) link layer security protocol called TeenySec is proposed in this paper. WSNs are caused by a lot of vulnerability because of factors such as hardware constraints of the sensor nodes, wireless communication medium, real-time computing, heterogeneous structure, large number of nodes, scalability, mobility, weight and cost requirements of application environment. In sensitive WSN applications like surveillance of enemy lines or border areas, security protocols must be used which provide confidential data transfer from sensors to base station. In this study, a new data link layer protocol is developed which is called TeenySec. The TeenySec combines the advantageous aspects of the Corrected Block Tea Algorithm (XXTEA) with the Offset Codebook Mode (OCB) approaches. TeenySec provides data confidentiality, data integrity, data freshness and data authentication and is also energy efficient. Moreover, proposed protocol has been implemented on the TelosB nodes. The security has been increased in the developed protocol. Also, better results have been obtained than TinySec, MiniSec and SNEP in energy consumption and memory usage which are very important for WSNs. Copyright (C) 2017 John Wiley & Sons, Ltd.