Error shows in receiver code for RC4 decryption

The RC4 code shouldn't be using strlen() since valid encrypted strings will contain null bytes,
strlen assumes a null byte terminates the string. You need to pass in a length count as well as the
char* pointer to the routine.

Also what are you trying to achieve - encryption without authentication isnt normally useful.