## 2 Motivation  
In international literature, up until the first decade of the 21 st century, the cryptographic analysis of stream ciphers or random number generators has become customary by applying statistical tests to their outputs to measure their degrees of randomness [41; 42; 43]. There are numerous statistics among those grouped in the batteries of NIST [44], Diehard [45], TestU01 [46], and [PERSON] [47], among others [48]. These tests have become standard, but since the first decade of this century, there has been a considerable increase in studies that show the inability of these tests in detecting other weaknesses that lead to the appearance of related keys, considerably weak keys due to the provocation of patterns in outputs, statistical dependence between inputs and outputs, statistical dependence between internal state and outputs, etc. Weaknesses that can cause attacks [49; 50], which are practical or not, are considered to maintain a cipher in the suite of some computer applications. In this way, it is essential to avoid the previous weakness and to have methods to detect it in the design and evaluation stage of the algorithm. In particular, it is necessary to have statistical tests that are capable of detecting the existence of significant statistical dependencies between the inputs and outputs of stream ciphers. In general, there are very few statistical test reports to detect the existence of statistical dependencies between the outputs and inputs of a stream cipher. Therefore, the design of statistical tests that allow for their evaluation in this sense is highly important in cryptography. In [49; 50], Algorithms 1 and 2 were presented to extend the strict avalanche and bit independence criteria stream ciphers, respectively. ```
0:\(f\), \(n\), \(m\), \(\alpha_{1}\), \(\alpha_{2}\), \(D\). 0: If \(f\) satisfies the SAC
1:\(T=0\)
2:for\(i=1\to n\)do
3:for\(r=1\to l\)do
4: Compute \(V_{r}^{i}=Y_{r}\oplus Y_{r}^{i}\)
5:endfor
6:for\(j=1\to m\)do
7:if\(\chi_{v_{j}^{j}}^{2}>\chi_{\alpha_{1,1}}^{2}\)then
8:\(T=T+1\)
9:endif
10:endfor
11:endfor
12:if\(Z_{T}>Z_{1-\alpha_{2}}\)then\(f\) does not satisfy the SAC
13:else\(f\) satisfies the SAC
14:endif
```  
**Algorithm 1** SAC stream ciphers algorithm ```
1:\(f\), \(n\), \(m\), \(\alpha_{1}\), \(\alpha_{2}\), \(D\). 2:If \(f\) satisfies the BIC
3:\(T=0\)
4:for\(i=1\to n\)do
5:for\(r=1\to l\)do
6: Compute \(V_{r}^{i}=Y_{r}\oplus Y_{r}^{i}\)
7:endfor
8:for each\((j,k)\)do
9:if\(\chi^{2}_{s_{k}^{i}}>\chi^{2}_{\alpha_{1},1}\)then
10:\(T=T+1\)
11:endif
12:endfor
13:endfor
14:if\(Z_{T}>Z_{1-\alpha_{2}}\)then\(f\) does not satisfy the BIC
15:else\(f\) satisfies the BIC
16:endif
```

**Algorithm 2** BIC stream ciphers algorithm

In applying both criteria, the RC4 stream cipher was used as a test case to evaluate the effectiveness of the proposed algorithms experimentally [49, 50]. As a result, it was shown that the RC4 presents a weakness of statistical dependence when large input keys are used. Although this weakness is not new, it has been reported in previous works. It is interesting to highlight the proposed evaluation using these two algorithms to determine its presence. As mentioned, there are numerous modification proposals on the RC4 stream cipher. The main motivation of this work is to evaluate whether some of the RC4 variants present this weakness. For this, both algorithms will be applied to the five most well-known RC4 variants RC4+ [27], VMPC [25], RC4A [26], NGG [23], and GGHN [24]. The results will be compared experimentally with those obtained for RC4. ## 3 SAC and BIC

Let \(D=\{X_{r}|1\leq r\leq l\}\) the set of \(n\)-bit inputs \(X_{r}\) of a function (cipher) \(f:\mathbb{F}_{2}^{n}\rightarrow\mathbb{F}_{2}^{m}\) and \(Y_{r}=f(X_{r})\) the output of \(m\) bits corresponding to the input \(X_{r}\) for each \(1\leq r\leq l\), where \(n,m\in\mathbb{N}\).