# Attacks against RC4 when index $i$ is unknown

RC4 uses two 8-bit indices. One, $$j$$, is key-dependent and secret, and the other, $$i$$, increments by one for each byte output. The $$i$$ index is typically considered to be public, but what if the RC4 keystream starts at an unknown position, putting $$i$$ anywhere in the range of $$0$$ to $$255$$ with equal probability? I can think of a few inefficient and naïve techniques, but what would be the most efficient technique to discover $$i$$?