# Securing IoT: Mitigating Sybil Flood Attacks with Bloom Filters and Hash Chains
## 2 Background
### Hash Chain  
A hash chain is a cryptographically secure sequence of values that can be used to verify data integrity and ensure chronological order. A hash chain is created by applying a cryptographic hash function to an initial input, known as the seed, then iteratively applying the hash function to the resulting hash value [18]. The inherent one-way property of cryptographic hash functions makes them computationally impossible to reverse. This prevents derivation of the original seed or any preceding hash values from a given hash value in the chain, even in the event of collisions (where different inputs produce the same hash output).  
A hash chain is a cryptographically secure sequence of fixed-size values constructed using three elements:  
* Number of Hashes (\(x\)): This parameter defines the length of the chain, specifying the number of times a cryptographic hash function will be iteratively applied.
* Hash Function (\(h\)): This element identifies the specific cryptographic hash function used to generate the chain. Common choices include SHA-256, MD5 (although its use is discouraged due to security weaknesses), and other functions with well-defined collision resistance properties.
* Seed (\(k\)): This is the initial input value that serves as the starting point for the chain. The seed can be of any data type suitable for the chosen hash function. The hash chain construction can be formally defined as follows:
* The initial hash value \(h^{x}\) is obtained by applying the hash function \(h\) to the seed \(k\): \[h^{x}=h(k).\] (2)
* Starting from the second hash value, the hash function is applied iteratively to the previous hash value in the chain. This generates the remaining hash values: \[h^{x-1}=h(h^{x}),h^{x-2}=h(h^{x-1}),\ldots,h^{1}=h(h^{2}).\] (3)
* The final hash value in the chain \(h^{0}\) is designated as the root hash. It is derived by applying the hash function to the second-to-last hash value: \[h^{0}=h(h^{1}).\] (4)  
To strengthen the security of transmitted messages, the proposed method incorporates a novel approach utilizing hash chains to generate a sequence of one-time passwords. This mechanism offers several advantages over alternative techniques such as Merkle hash trees.  
In addition to its security benefits, the use of hash chains offers potential advantages in terms of both communication and computational efficiency. The sequential nature of hash chains allows for more compact representation of message authentication information compared to Merkle trees, resulting in reduced message size and lower transmission costs. Moreover, the computational overhead associated with hash chain generation is generally lower than that of Merkle trees, making hash chains particularly suitable for resource-constrained IoT environments [19].  
While Merkle trees excel in certain applications, their suitability for generating sequential one-time passwords is limited. The inherent structure of Merkle trees does not naturally lend itself to the creation of ordered cryptographic values. Although adaptations could be made to accommodate this requirement, they would introduce additional complexity and potentially diminish the performance benefits often associated with Merkle trees [20]. By employing hash chains, our proposed system effectively addresses the critical challenge of message authentication while optimizing resource utilization in IoT networks.