Re: VB6 (Custom RC4) To PHP
The PHP website (www.php.net) has an excellent manual. I would also advise against using the above function because it is not an RC4 implementation (in fact there is a bug in your key scheduling that will result in the same key whatever password you use). The cipher text produced from this would be about as secure as a door made from jelly; I suggest you remove this code from any application you are currently using it in.
PHP supports a number of recognised encryption libraries (http://uk3.php.net/manual/en/refs.crypto.php). I suggest you use one of these.