## 1 Introduction  
Internet of Things is becoming more and more widespread with the use of sensor networks and the so-called wearables that allow for the exchange of information in real-time--information that is used on many occasions in order to make decisions or control any system in a remote way. Thus, the prevalence of traditional human-to-human or human-to-machine communications is being progressively substituted by the exponential increase in machine-to-machine communications [1]. Therefore, a conventional security architecture, where there exists an authority in charge of safeguarding and/or generating session keys, does not address all security issues appearing in this paradigm given that it does not take into account patterns where machines communicate directly to machines and distributed computing forms are gaining importance in the communication processes [2]. Due to the open characteristics of these systems, the privacy of the transmitted data is becoming a major concern [3, 4]. Therefore, a key to solving this issue is Group Key Management using a distributed solution, i.e., users (that could be machines) collaborate to build a common session key that is used to encrypt communications among members of the group. Examples of this type of protocol can be found in [5, 6, 7, 8] [Chapter 9] and references therein. Probably one of the best-known protocols for distributed Group Key Management is CLIQUES. This protocol, proposed by [PERSON] et al. in [9], belongs to the so-called generic Group Diffie-Hellman (GDH) key agreements. In this paper, the authors introduce a series of protocols on an algebraic cyclic group \(G\) of order \(q\) that the communicating parties \(\mathcal{U}_{1},\ldots,\mathcal{U}_{n}\) agree on, as well as a generator of the group \(\alpha\). Each party holds a private element \(N_{i}\in\mathbb{Z}_{q}\), \(i=1,\ldots,n\). All these protocols are based on distributively computing a subset of \(\left\{\alpha^{\Pi(S)}:S\subset\{N_{1},\ldots,N_{n}\}\right\}\) and each party \(\mathcal{U}_{i}\), \(i=1,\ldots,n\), from \(\alpha^{\Pi\left(N_{p}\right|p\in[\left\lfloor\mathcal{1},n\right\rfloor),\ p \
eq i}\) can easily obtain \(K=\alpha^{N_{1}\cdots N_{n}}\). In these protocols, one of the members, namely, \(\mathcal{U}_{n}\) has a greater computing load and, in order to equalize it for every party, the authors consider a detached protocol where every party has almost the same workload. However, it is precisely the nature of this protocol that allowed [PERSON] et al. in [10] to provide an active attack on it based on the well-known man-in-the-middle attack for the case of an attacker that is able to control communications of the users with a special role in the group, namely \(\mathcal{U}_{n-1}\) and \(\mathcal{U}_{n}\) during the set-up phase. The authors show that an attacker can forge \(\mathcal{U}_{n-1}\) and \(\mathcal{U}_{n}\) activity in order to make every party think that they are exchanging the necessary information to build a common key only known by themselves, but that, in fact, it is also known and constructed with the collaboration of their own attacker without knowing the existence of this malicious activity. Thus, the attacker becomes a legal member that is unknown by the other parties of the communication group, and it can obtain all the data transmitted using the common secret they have collaboratively built. They also show that it is possible to use a strategy so that the attacker can leave the group without letting the group members know about the attack. The traditional method of avoiding an impersonation attack is to use some additional information that provides authentication. Public key infrastructure (PKI) provides the basis of authentication and access control in most networked systems.