Protecting smart devices from hackers