def rc4_encrypt(key, data):
if len(key) < <NUM_LIT:5> or len(key) > <NUM_LIT:16>:<EOL><INDENT>raise ValueError(pretty_message(<EOL>'''<STR_LIT>''',<EOL>len(key)<EOL>))<EOL><DEDENT>return _encrypt(Security.kSecAttrKeyTypeRC4, key, data, None, None)<EOL>
Encrypts plaintext using RC4 with a 40-128 bit key

:param key:
    The encryption key - a byte string 5-16 bytes long

:param data:
    The plaintext - a byte string

:raises:
    ValueError - when any of the parameters contain an invalid value
    TypeError - when any of the parameters are of the wrong type
    OSError - when an error is returned by the OS crypto library

:return:
    A byte string of the ciphertext