Research Article

Just Shake Them Together: Imitation-Resistant Secure Pairing of Smart Devices via Shaking

Algorithm 4

Mutual authentication and key extraction.
Require: 1) The bit series: , its length is . 2) The number of bits required in key generation: . 3) The threshold for mutual authentication: .
Ensure: The extracted key: .
1: Initialize a sliding window of size along the bit series . Set the index .
2: whiledo
3: Obtain the bit string inside window as , generate a random number , and call HMAC() to obtain a bit string .
4: Forward the window along the bit series with 1 bit.
5: Send the series with length to the peer device via broadcasting.
6: Receive the series with length from the peer device.
7: Compute the edit distance between and , compute , find the matching components of and from and accordingly.
8: ifthen
9: Authenticate the peer device as an authorized device.
10: Find the first matching components of and from and , verify the consistency between the locally generated bits with the bits from the peer device based on the following matching results.
11: Compute the edit distance between and , find the matching bits and divide them into multiple blocks, calculate the hash code for each block , i.e., =HMAC(), assemble them as a bit series, and extract the first bits into the key .