## 4 Attack Resistance
### Identity Attacks  
Malicious nodes can pretend to be other nodes in order to implement one of the attacks mentioned above. We will consider four different types: clone, thief, mole and sybil. * The _clone attack_ consists in duplicating an operating node. Both nodes, simultaneously, communicate with the same identity. * In the _thief attack_, a malicious node steals an operating node its identity and replaces it in the network. The malicious node stops original node's operation and takes advantage of its reputation and trust levels. * A _mole_ is a malicious node that behaves as a well-operating node, with a fabricated identification, to achieve high levels of trust and reputation. Once inside, it can attack the system from a privileged position. A variation is the _on-off_ attack, where the malicious node behaves well and badly alternatively, in order to maintain a high average level of trust. * The _sybil attack_ occurs when a malicious device presents multiple identities, as if it were multiple nodes, in order to control a substantial fraction of the system. This attack reduces the effect of the system's redundancy without the need of numerous physical nodes. The attacks can be performed at any layer of the protocol stack, but they are more profitable in the upper layers, like network or application. The first three attacks are carried out by individual malicious nodes, and they can be considered special cases of the sybil attack. The sybil attack was first introduced in [24]. [PERSON] [25], [PERSON] [40] and [PERSON] [41] make thorough descriptions of the taxonomy, threats and countermeasures of identity attacks, focusing on the sybil attack. We can find three main types of solutions to the identity attacks: resource testing, cryptography and location-based. Resource testing solutions assume that devices are limited in some resource [24]. The solutions consist in testing a limited resource and checking that each identity has no less capability than a physical node. The resource tested in wireless sensor networks, according to [PERSON] [25], is the radio communication capability, considering that a device can access only to one radio channel at a time. Each identity has a channel assigned and they must send a message through it simultaneously. The system detects an identity of a sybil attack when it receives no message in its channel. Accurate synchronization between the monitoring devices is needed and, if we have more identities than channels, we can't perform the test to every identity at the same time, so the detection rate decreases. Cryptography schemes base their efficiency in secure communications, and the different solutions differ in how to establish the keys: the key agreement process. They can have a key server with the public key of all nodes, and only establish a key through the key server. Another scheme uses the self-enforcing scheme approach, based on asymmetric cryptography with public key. Efficient implementations of Elliptic Curve Cryptography (ECC) Cipher Suites can be used in sensor networks to establish secure links, but it is not enough to avoid the sybil attack, because a malicious device may have more resources than the normal nodes. The third key agreement mechanism is key pre-distribution scheme [42, 43, 44]. In these systems each sensor has a subset of the system keys and a secure link is established between nodes which have at least one key in common. If a node is compromised, several keys are known by the malicious device. If more nodes are compromised, the attackers can obtain a substantial fraction of the system keys. Location based solutions [45, 46], check that no identities are at the same position. The solutions assume that the sensor nodes are static, but real AmI applications have heterogeneous networks, with static and moving nodes. The accuracy of the location system should be high due to the high density of sensors inherent to AmI applications. Clone, thief and mole attacks use only one identity, so their effect is the same as compromising a sole node.