Implementation of the RC4 algorithm.