# Key Agreement and Authentication Protocols in the Internet of Things: A Survey
## 2 Materials and Methods
### Cryptographic Methods  
Cryptography is the science of creating the algorithms and protocols necessary to protect information. Information protection is related to such concepts as data encryption, electronic communication privacy protection, authentication, or key agreement [52; 53; 54; 55]. The most characteristic process related to cryptography is the encryption process. It consists  
Figure 1: IoT solutions and typical cyberattacks on IoT systems.  
of transforming information from plaintext into a form that will be incomprehensible to outsiders.  
Encryption is the process of transforming (encrypting) information (plaintext) into a form that is incomprehensible to outsiders. An encrypted message is called a ciphertext. The reverse of encryption is the decryption process, which recovers the original message, or plaintext, from the ciphertext. The security of cryptographic algorithms is often achieved by using an additional secret parameter known as a cryptographic key. Their use ensures that even if the intruder knows the algorithm used to encrypt the message, he will not be able to decrypt it unless he has the key. Thus, the ciphertext is safe as long as the secret key used in communication is [52; 53; 54; 56; 57].  
Key encryption algorithms can be divided into symmetric and asymmetric [16]. In symmetric algorithms, also called secret-key algorithms, it is possible to obtain a decryption key from an encryption key. There are also situations in which the keys are identical. In the case of symmetric algorithms, a secret key must be agreed upon between the communicating parties before commencing communication using a secure method. This is related to the problem of key agreement. To have a safe, symmetrically encrypted feed, we need a secure communication channel to forward the key [54; 58; 59].  
On the other hand, asymmetric algorithms use key pairs assigned to users. Such a pair are the public and private keys. [PERSON] and [PERSON] presented the concept of a public key in [60]. The public key is known to all users, and anyone possessing it can encrypt their messages. However, the ciphertexts obtained this way can only be deciphered with the corresponding private key. The user must be sure that his public key corresponds to his private key. Thus, the public key encrypts, and the private key decodes the message. However, there is a situation in which the roles of the keys are reversed. If the message is encrypted with the private key, the resulting ciphertext becomes the so-called electronic signature, i.e., protection against unauthorized modification. Decryption is then possible by using the public key [54; 58; 59].  
When the data to be signed is large, it takes a long time to sign. Hash functions or hashes are used in these situations, and their operation is based on appropriately processing extensive data to a smaller size. Hash functions are primarily used to check and confirm the authenticity of data, ensuring that the data has not been tampered with in an unauthorized manner. The mentioned functions are unidirectional, so it is impossible to reconstruct the data based on the hash itself. This means that the whole message that has been signed [61; 62] must be sent with the electronic signature.