## 7 Weak Authentication
=G
38:symbolic Pub, Pri, pwd
39:#Actual variables
40:BaseStation, Node, Attacker : Agent
41:W, ds, dn: Num
42:n1, n2: Nonce
43:#System
44:BASE(BaseStation, ds)
45:MOTE(Node, dn, n1)
46:#Intruder Information
47:Intruder = Attacker
48:IntruderKnowledge = {Node, Intruder, W, n2, Pri(Attacker)}
```

**Algorithm 4** (_Cont._)

ECDH key agreement is prone to man-in-the-middle attacks, unless it is used in an authenticated channel. As the communication medium of Seltape++ is not authenticated, Seltape++ is evaluated against this attack. The results of FDR2 (Figure 8) show that Seltape++ is able to successfully establish a shared session key, which is only accessible among the base station and the node. In Algorithm 4, after the session key (\(SK\)) is successfully established, another session key (pwd(BS, ND)) is used, because of the limitations in Casper. This does not violate any rule, because \(SK\) is tested to be secure, and the results in Figure 8 show this fact; also, pwd(BS, ND) is not included in the intruder's knowledge section, which means the attacker does not have a value of pwd(BS, ND). ### Compatibility with SMR

As we have discussed in Section 5, there are a number of prerequisites that are essential to be employed by any OTAP scheme in order to make it secure. Consequently, Seltape++ complies with SMR to provide an improved secure scheme that not only preserves the security concepts (e.g., confidentiality, integrity, availability, authenticity), but also provides robustness against very common attacks that occur during the dissemination of a code update, like replay, battery-drain and wormhole attacks. Table 7 shows how Seltape++ complies with SMR. Skipjack is a block cipher developed by the U.S. National Security Agency (NSA) [38]. It was first proposed as the encryption algorithm in a U.S. government-sponsored scheme of key escrow and used only for encryption. The design was initially secret, but was later declassified. Skipjack is a 64-bit cipher that utilizes an 80-bit crypto variable. Some security analysis has been done by researchers to show Skipjack's strength and to highlight the advantage of using it in wireless sensor networks [38; 39; 40; 41; 42]. Another feature used in Seluge++ to preserve the integrity and authentication is the hash function of SHA-1 and the keyed message authentication code (HMAC) based on SHA-1. Researchers have published some works on the security analysis of SHA-1 [43, 44] and the security analysis of HMAC [45, 46]. These works can be used to determine the suitability of these algorithms in wireless sensor networks. As noted in SMR, a combination of immediate packet verification and HMAC prevents any successful attack against Seluge++. Since each packet is immediately verified as soon as it arrives at the node end, no successful DoS attack is possible. In Seluge++, Line 44 through 46 of Algorithm 2 is responsible for preventing DoS attacks. A symmetric key is also vulnerable to brute-force attacks. Since the symmetric key in Seluge++ is randomly generated for each entire process, therefore it is very unlikely to encounter a successful brute-force attack. To solve the authentication delay problem, SMR suggests using message authentication code. When MAC is used, packets can arrive out of order, and the node can verify them without the need to wait for previously ordered packets. In Seluge++, this is helpful while sending page 0, which contains the hash values of page 1, and therefore, all other pages can be immediately verified as soon as they arrive at the node level, resulting in no authentication delay problems.