Error shows in receiver code for RC4 decryption

UKHeliBob:
How about good, old fashionedchar enc=Serial.read();but as you are reading a character before you know there is anything to read, and will get only one character anyway, you need to restructure your code.

Wait until there is something to read
Read characters until you get to the end. You need to know that you have reached the end
Add the characters to an array as each is received

Now use the array

See http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=11425&page=1

Thank you for your answer. I am checking your provided link at first. Thanks