<div dir="ltr"><div><div>Feed RC4 through a transposition cipher... essentially a single round 2048-bit block cipher.<br><br>S1: 256 permuted bytes, serves as the PRGA<br>S2: 256 permuted bytes, serves as the transposition cipher<br>
S3: 256 empty values, serves as the output array<br>S4: 256 empty values, serves as the output array to rescramble the transposition cipher<br><br>i := 0 (S1)<br>j := 0 (S1)<br>while GeneratingOutput:<br> i := i + 1<br>
j := (j + S1[i]) mod 256<br> swap values of S1[i] and S1[j]<br> K := S1[(S1[i] + S1[j]) mod 256]<br> output K to position S2[i] in S3<br> XOR K and S4[i]<br> if i = 255<br> output S3<br> while i > 0<br>
swap values of S2[i] and S2[S4[i]]<br> i := i - 1<br>endwhile<br><br><br></div>This should flatten the biases in the first 256 bytes of RC4. It should also reduce the relationship between byte values and the internal state. <br>
<br></div>I call this XARC4.<br></div>