# Key Agreement and Authentication Protocols in the Internet of Things: A Survey
## 5 Conclusions  
In this manuscript, we surveyed papers that proposed key agreement and authentication protocols for the Internet of things and wireless sensors networks. We collected papers focusing on problems with security, especially in IoT that offer new protocols aimed at correcting vulnerabilities in existing protocols. We discussed the theoretical aspects of IoT environments, cryptographic methods that can be used to secure communication, and cyberattacks that can compromise the security in the environments under consideration. We highlighted the key agreement, distribution process, and authenticating users or devices on such networks in this manuscript. These processes provide critical communication steps as they prevent unauthorised access to session keys and unauthorised access by unauthorised users or devices. Data transferred between network nodes can be of different natures and importance, and they need to be appropriately secured during communication. All communications are exposed to dishonest users called attackers. Attackers' activity may involve attacks on various aspects of the network, such as passwords, keys, biometric data or devices, and eavesdropping and retransmitting the same messages. We looked at various solutions related to authentication and matching of session keys. The authors of the protocols under consideration focused on essential security properties such as untraceability and anonymity, and the solutions' authors focused on crucial security features. The authors also validated their protocols with formal and informal methods that considered the vulnerability of these protocols. Various techniques (e.g., BAN logic or GNY) and automatic tools (e.g., Scyther, ProVerif) were used for verification. Thanks to the methods and tools used, the authors showed what level of security is provided by the protocol they propose. The selected protocols' analysis showed that the most dangerous attacks for IoT are impersonation attacks, MITM attacks, and replay attacks because the susceptibility to these attacks was most often checked and verified by the authors of the selected works. During impersonation attacks, the attacker identifies himself with another user on the network and tries to convince other users of his identity. The replay attack involves duplicating packets and sending them multiple times. At any time during this attack, the attacker can also use a MITM attack to intercept transmitted messages. A successfully conducted attack may result in the loss of confidential data, which may cause further problems for the user. The essential protection principle against attacks is using timestamps in messages and one-time session keys. Timestamps will allow us to verify the time when a message was generated. On the other hand, disposable session keys will prevent the repeated sending of a message encrypted with an outdated key. Other types of attacks cannot be underestimated. Attacks during which the attacker tries to guess the password (guessing attacks) and the loss of data or devices that verify the user (stolen attacks) are equally dangerous. Such situations may contribute to the fact that an unauthorized user can log in with the correct credentials of an honest user and thus impersonate him. After analyzing the current state of knowledge in the security protocols for IoT and WSN environments, we set out to indicate further research directions in this area. Here we can indicate the three most important aspects that should pay attention to constructing secure protocols for IoT. The first is security. Protocols should provide an appropriate level of security for users and data sending because the methods of breaking security are constantly evolving. Therefore, research goals in security protocols for IoT and WSN environments should focus on technologies and solutions that provide increasingly better security. The elliptic curve algorithms are particularly noteworthy here, because they offer security comparable to the Rivest-Shamir-Adleman algorithm when using shorter encryption keys.