# REISCH: Incorporating Lightweight and Reliable Algorithms into Healthcare Applications of WSNs
## 3 Preliminary Techniques for Our Data Collection Scheme
### Overview of Techniques Used in REISCH
These procedures are described as follows:  
* **Key generation:** 1 Select a pseudorandom integer private key (\(K_{pr}\)) and compute public key (\(K_{pu}\)) \(=K_{pr}G\)
* **Signature generation:** 1 Select a pseudorandom integer \(k\), \(1\leq k\leq n\)-1. 2 Compute \(e\) = SHA1 (\(d\)) and \(kG=(x_{1},y_{1})\). 3 Compute \(r=x_{1}\) mod \(n\). If \(r=0\) then go to Step 1. 4 Compute \(k^{-1}\) mod \(n\) and \(s\)\(=k^{-1}(e+K_{pr}r)\)mod \(n\). If \(s=0\) then go to Step 1, else signature for the message m is \((r,s)\). * **Signature verification:** 1 Verify that \(r\) and \(s\) are integers in the interval [1,\(n\)\(-\)1]. 2 Compute \(e\) = SHA1 (\(d\)). 3 Compute \(w=s^{-1}\) mod \(n\), \(u_{1}=ew\) mod \(n\), \(u_{2}=rw\) mod \(n\) and \(X=u_{1}G+u_{2}K_{pu}\). 4 If \(X=\theta\), then reject the signature. Otherwise, convert the \(x\)-coordinate \(x_{1}\) of \(X\) to an integer \(\bar{x}_{1}\), and compute \(v=\bar{x}_{1}\) mod \(n\), accept the signature if and only if \(v=r\). ECDSA becomes inappropriate to sign \(d\) if applied poorly and incorrectly. It becomes reliable if the parameters are validated effectively [46]. In RESCH, we use ECDSA-256 bit to add a high-security level and take care to consume system resources. * **Integrity and authentication of EMRs** In this subsection, we explain the two one-way hash functions, both of which are related to our study. * **SHA family** Secure Hash Algorithm (SHA) is one of the traditional hash algorithms that provides integrity and authentication when used with digital signatures. For instance, SHA1 was used in the ECDSA algorithm to perform the signature process. SHA consists of several varieties: SHA0, SHA1, SHA2, and SHA3. Both SHA2 and SHA3 consist of SHA224, SHA256, SHA384, and SHA512, but SHA3 uses a different structure than the rest of the SHA family. SHA0, SHA1 and SHA2 are built on the basis of the Merkle-Damgard structure, as shown in Figure 2[47], and were designed by the National Security Agency (NSA). SHA3 is also known as ECCCAK and is built on sponge construction and uses two-stage absorbing and squeezing. Since 2007, NIST has adopted KECCAK because of the practical attacks on SHA0, SHA1, and SHA2. KECCAK became the rival standard in 2015 [47]. However, some research [48,49] has indicated that SHA3 can suffer from fault injection threats. SHA is a one-way function consisting of two phases that divide the message into blocks of the same size (such as 512 or 1024). A set of zeros is added and followed by one at the end of the last block of the message [18]. This phase is called preprocessing or padding. The second stage is the MD computation. At this stage, all message blocks are entered into the iterations (SHA1 (80), SHA2 (64), and SHA3 (256)) one by one, containing constants and logic operations (OR, AND, and XOR) in the compression function (\(F\)) to produce MD. Each hash algorithm produces a fixed length of MD such as 160 for SHA1 and 224, 256, 384, and 512 for SHA2 and SHA3 [50]. Table 1 shows the comparison between SHA1, SHA2, and SHA3 [51]. Many existing schemes to collect data in WSN [52; 53; 18; 54] have used the SHA algorithm to support integrity and authentication. However, these schemes do not address the collision and preimage problems in the SHA algorithm [31; 32; 33; 34; 35].