As far as my RC4 encryption function, just copy-and-paste the rc4dropn function into the top of your file. Then, establish the secret number as above. Then, set up the stream like this:
cipher = rc4dropn(tostring(sharedNum), 512)
To encrypt data, just do this:
encrypted = cipher(tostring(data))
or
encryptedTable = cipher(textutils.serialize(dataTable))
Finally, transmit that encrypted data how you normally transmit unencrypted data.
On the receiving end, establish the secret number the same, set up the cipher the same, receive the encrypted data as normal, then do this:
decrypted = cipher(encrypted)
or this:
decryptedTable = textutils.unserialize(cipher(encryptedTable))
Be sure to decrypt everything in the same order as you encrypt it (not reverse order), or else it won't decrypt properly.