The concept of the Internet of Things (IoT) has evolved over time. The introduction of the Internet of Things and Services into the manufacturing environment has ushered in a fourth industrial revolution: Industry 4.0. It is no doubt that the world is undergoing constant transformations that somehow change the trajectory and history of humanity. We can illustrate this with the first and second industrial revolutions and the information revolution. IoT is a paradigm based on the internet that comprises many interconnected technologies like RFID (Radio Frequency Identification) and WSAN (Wireless Sensor and Actor Networks) to exchange information. The current needs for better control, monitoring and management in many areas, and the ongoing research in this field, have originated the appearance and creation of multiple systems like smart-home, smart-city and smart-grid. The IoT services can have centralized or distributed architecture. The centralized approach provides is where central entities acquire, process, and provide information while the distributed architectures, is where entities at the edge of the network exchange information and collaborate with each other in a dynamic way. To understand the two approaches, it is necessary to know its advantages and disadvantages especially in terms of security and privacy issues. This paper shows that the distributed approach has various challenges that need to be solved. But also, various interesting properties and strengths. In this paper we present the main research challenges and the existing solutions in the field of IoT security, identifying open issues, the industrial revolution and suggesting some hints for future research.