The emergence of the 5th generation wireless standard for telecommunications (5G) will enable the Internet of Things (IoT), a huge network of interconnected devices that can be utilized in almost every aspect of our daily lives, either that is in healthcare, transportation, environmental monitoring, and so on. As good as it sounds though, individuals with malicious intent will always be around to try and compromise what has been built for their own personal gain. Therefore, nothing can be accomplished unless the system and communication between devices is secured, and we are positive that the privacy and well being of users, and society in general, is ensured. This chapter will present the notion of smart spaces and smart grids along with their architecture and way of operation. It will also stress the necessity for securing the various processes and services of such technologies, in order to predict, identify, prevent and counter any potential attacks on the system as well as protecting and preserving the privacy of the users. Furthermore, the chapter will include the security requirements a system needs to fulfill, along with any security threats that might compromise the system and various measures that need to be taken to achieve a secure environment.