# Hamida

Quantization is a part of the process using Radio Channel Measurements to generate a secret key. Thereby the quantization is thereby the second step of the Key Generation, which can be considered by the Figure on the left side.The quantization is a signal processing function which maps a large set of numbers to a smaller set. Therefor it exists multiple different schemes. In this article, we want to introduce the Quantization Algorithm from Hamida et al. ^{[1]}.

## Motivation

First quantization algorithms based on fixed threshold which is set by the two communication partners (i.e. Alice and Bob). The principle of this algorithm is as follows: Alice and Bob compare the estimated received signal to the shared threshold, if the amplitude of the sample is above the threshold the bit is set to 1 otherwise to 0. In some cases, the binary generated sequence is not really random. Therefore, the key is not secret and an attacker can easily break the secret key. Now Hamida et al. wanted to introduce a better quantization scheme.

## Key establishment with quantization

M should be the user who wishes to create a secret key. **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle h_M(t)}**
is the length of the channel estimation, which when corrected, the length of the shared key is identical. The key generation algorithm can be described as follows.

First M estimates the noise variance N in the environment. This must be done when no activity was observed in his vicinity. The calculated value is set as the minimum threshold to reduce the probability of detecting bits by mistake. In this time the channel uses a known signal, which is given for example in a standard communication packet, to estimate the **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle h_M}**
. Next M determines two thresholds **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle L_+ = max(h_M)}**
and **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle L_- = min(h_M)}**
. This threshold corresponds to the positive and the negative amplitude of the received signal. If a sequence is above the threshold (**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle h_M[i] > L_+)}**
then the binary vector **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle BV_M(i)=1}**
else if the sequence crossed the lower threshold(**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle h_M[i] < L_-}**
) then **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle BV_M(i)=0}**
. The position of the extracted bits is saved on a table of positions. Then M adjusts the threshold values: **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle L_+ + max(h_M) / \delta }**
and **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle L_- = L_- - min(h_M) / \delta}**
where **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle \delta}**
is a protocol parameter. This process is shown vivid in the next Figure:

After this M repeats to calculate new thresholds boundaries and adjustments. This is done repetitive until the noise level is reached or the length of binary vector is equal to the secret key length (fixed at 128, 256 bits, or more). To guarantee that M has the same key candidate with the other communication partner an error correcting scheme is implemented. Therefore we suppose that B is the receiver and A is the emitter. In this case, A sends to B the index positions table. B compares the two tables (the one it computed and the other one it received from A) to find the disagreement bits which will be discarded and sends to A the positions of deleted bits.

A deletes the dissimilar bits and controls if the candidate key **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle K_A}**
is equal to **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle K_B}**
. Therfore, A chooses a node R then encrypts it with **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle K_A}**
and sends the message **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle S_A = EK_A(R)}**
to B, who decrypts the received message **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle SR_B = DK_B(S_A)}**
adds one and sends **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle S_B = EK_B(SR_B + 1)}**
. A decrypt the received message **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle SR_A = DK_A(S_B)}**
and verifies if **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle SR_A}**
is equal to her random node R+ 1. Then, an acknowledgement is sent to B to confirm the agreement or disagreement result.

## Key Renewal Process

After the key establishment, a process to renew the key is started. Therefor A calculates a node X, which must be contain a sufficient length and sends it encrypted to B, like mentioned before. Each node holds the condition **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle K = K_A \oplus X = K_B \oplus X }**
where the **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/wikimedia.org/v1/":): {\displaystyle \oplus}**
is bitwise XOR.

## References

- ↑ Hamida et al. (2009), An Adaptive Quantization Algorithm for Secret Key Generation using Radio Channel Measurements, ISBN: 978-1-4244-4765-7