# Security Challenges for Light Emitting Systems
## 4 Results and Discussion  
The idea is to review the Berlekamp-Massey, and at the end modify the result and adapt an error correction to the transmitted message. Let us take the message to be sent m = 110,111,000 with a length of 9 bits, we will unroll the modified Berlekamp-Massey; results are presented in Table 2. From Table 2, N is the number of bits in the sent sequence, \(\text{S}_{\text{N}}\) denotes the number of bits in the sent message, L represents the number of errors, and M denotes the size of the LFSR produced by Berlekamp-Massey. We will consider d, the key created by our method. Each sent message creates a secret key, and f(x) and g(x) are the error locator polynomials, which determine the erroneous symbols that occur during message transmission, and the error estimator polynomial, which corrects the symbols that contain errors, respectively. To encode our previous message (m), we apply an XOR between m and the key obtained by the BM algorithm that we modified; this key will be on 3 bits, for the digits obtained, different from \"0\" and \"1\". The encrypted message is d(x). Now, to decode d(x), we reapply an XOR between it and k in binary. The decoded message d(x), then with errors, to correct these errors, we will go through (02) steps:  
_First step:_ we apply an XOR between the initial message (m) and the key this time on 4 bits for the digits different from 0 and 1, we will call the result obtained p(x). _Second step:_ an XOR will be applied between the d'(x) and p(x). **Demonstration:**  
_Encode:_ m \(\oplus\) key (3 bits): [1 1 0 1 1 1 0 0 0] \(\oplus\) [1 0 1 0 1 0 1 0 0] = [0 1 1 1 0 1 0 0]: d(x). _Decode:_ d(x) \(\oplus\) k (9 for this example): [0 1 1 1 0 1 1 0 0] \(\oplus\) [1 0 0 1 0 0 0 0 0] = [1 1 1 0 0 1 0 0]: d'(x). **Correction errors:**  
_First step:_ m \(\oplus\) key (4 bits) = [1 1 0 1 1 1 0 0 0] \(\oplus\) [1 0 0 1 0 1 0 0] = [0 1 0 0 1 0 0 0 1]: p(x). _Second step:_ d'(x) \(\oplus\) p(x) = [1 1 1 0 0 1 1 0 0] \(\oplus\) [0 1 0 0 1 0 0 0 1] = [1 1 0 1 1 1 0 0 0]. The rule \(\sum_{i=1}^{L}c_{i}\text{S}_{N-i}=0\) ensures that the Berlekamp-Massey algorithm runs correctly. The rule is assured for the results in Table 2.  
Berlekamp-Massey is a variant to the Reed-Solomon corrective codes, which consist, on the one hand, in constructing for successive values of N, an LFSR of length LN, and feedback polynomial \(\text{f}_{\text{N}}\), which generates the first N bits of the sequences [12]. The sequences sent (encoded) must be a multiple of a polynomial S(x), called the generator polynomial, known in advance to the sender and the receiver. We can show that, for N = 2L, the algorithm returns the feedback polynomial of the starting LFSR. On the other hand, to generate a key from the sent message, which will be of the same size of it, each message will have its own key; we cannot have two different messages with the same key. The receiver will receive the coded message with the key for decrypting the message, once authenticated; the user receives a secret code on his smartphone for the second authentication. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**N** & \(\text{S}_{\text{N}}\) & **d** & **L** & **f(x)** & **m** & **g(x)** \\ \hline  & & & 0 & 1 & \(-1\) & 1 \\
2 & 0 & 1 & 2 & x\({}^{2}+\text{x}+1\) & 2 & x + 1 \\
3 & 1 & 2 & 2 & x\({}^{2}+\text{x}+1\) & 2 & x +As mentioned before, the objective of Berlekamp-Massey is to find the minimal level of errors (L) and f(x) that conducts to all syndromes Sn + C\({}^{1}\)S\({}_{n-1}+\ldots+\) C\({}^{\text{L}}\)S\({}_{n-\text{L}}\), at every iteration, the algorithm calculates the value d, which we will consider at the end of our algorithm the key for each message. If d = 0, this means that f(x) and L are correct; we increment m and continue. If d0, the algorithm continues to run and recalculates each time f(x) until d = 0. [13]. The algorithm must also decrease the number of errors (L) if necessary [14].