Engineering and Technology Journal Vol. 37, Part A, No. 7, 2019 DOI: http://dx.doi.org/10.30684/etj.37.7A.10 Copyright © 2019 by UOT, IRAQ 290 Seyed Amin H. Seno Computer Engineering Department, Ferdowsi University of Mashhad, Iran Hosseini@um.ac.ir Sahar A. Alshammari Computer Engineering Department, Ferdowsi University of Mashhad, Iran Sahar.alshammari@mail.um.a c.ir Received on: 30/04/2018 Accepted on: 23/05/2019 Published online on: 25/07/2019 A Cooperation of Fog Computing and Smart Gateways in a Secure and Efficient Architecture for IoT-Based Smart Homes Abstract- Nowadays Internet of Things (IoT) is growing to be a serious factor in numerous areas of our daily life style. Internet of Things brings different opportunities of intelligence to important aspects such as health, payments, energy management, industrial sectors, transportation and also many other specialties. It is important to notice that the interaction between these two part the embedded equipment and Cloud based web services is such a common or prevalent scenario of Internet of Things deployment. When it comes to the security point of view, jointly users (consumer) and smart devices need to reassure and establish a secure and confident communication channel and should have a perfect form of digital identity. In many situations, IoT devices needs an already or earlier established infrastructure for their usage and that cannot be managed by the device owner, such as the case in smart homes. Furthermore, the scenario presupposes a security stack that it is appropriate for heterogeneous devices which can be integrated in Internet of Things frameworks or in already presented operating systems. We proposed a Foggy Smart Home Architecture (FSHA). We identify end users by writing an authentication and authorization protocol, and we will reduce the time required for this security operation, so that the proposed method can prevent Non-manipulation, online/offline password guessing attack and user impersonation attack and man- in-the-middle attack. Our method improves performance of smart home and using fog layer can minimize traffic between cloud and gateways. Keywords: fog computing, security, Internet of Things, Smart home, IoT, Authentication How to cite this article: S.A Alshammari and S.A. Hosseini Seno, A Cooperation of Fog Computing and Smart Gateways in a Secure and Efficient Architecture for IoT-Based Smart Homes,Engineering and Technology Journal, Vol. 37, Part A, No. 7, pp. 290-301, 2019. 1. Introduction The technique of CISCO lately relied on the accurate vision of fog computing in order to qualify applications on billions of active devices, previously connected in IoT, to have the ability of running directly at network edge. Consumer can do the processes such as developing, running, managing and deploying of software applications on Cisco IOx framework of networked resources, that holding hardened routers, switches and IP video cameras. However, Cisco IOx works with open source Linux and Cisco IOS network operating system cooperatively in a single networked equipment. The open application environment prompts more developers to connectivity interfaces at edge of network and bring their own applications. Nevertheless, of Cisco‟s utilizing, firstly let us take a look at Fog computing conception and make a clear comparison of what are distinction between these two illustrations Cloud and Fog. To start with, fog computing, services and facilities can be appended at the end equipment such as set-top-boxes or access point. The fundament of this modern distributed computing permits applications to run as close as possible to sensed actionable, massive data and processes and thing, coming out of people. Comparable with Fog computing conception, in fact a Cloud computing close to the „ground‟ creates automated response that drives the value. One and the other supply data, application services, storage and computation to the Consumer. But, Fog can be discrete from Cloud by its closeness to Consumer, dense geographical distribution and its support for mobility [1]. As a result of momentary development and expansion of IoT, there are various kinds of Internet of Things facilities and different kind of applications that participate to our daily life. Therefor they cover from conventional resources to general household objects that assist to make human being‟s life preferable. It is of considerable possibility. Meantime, there are a number of issues or challenges should be considered in path of IoT. In conditions of scalability, an IoT application that