code: public static byte[] encrypt(byte[] data, byte[] key) {
          checkNotNull(data);
          checkNotNull(key);
          checkArgument(key.length >= 5 && key.length <= 256);
          StreamCipher rc4 = new RC4Engine();
          rc4.init(true, new KeyParameter(key));
          byte[] encrypted = new byte[data.length];
          rc4.processBytes(data, 0, data.length, encrypted, 0);
          return encrypted;
      }
docs: Encrypt data bytes using RC4
  
  @param data data bytes to be encrypted
  @param key  rc4 key (40..2048 bits)
  @return encrypted data bytes