It might be helpful for you to explain how you think your code works, and what problem specifically
The client.cs file you've shared does not encrypt the request; it appears to attempt to obfuscate the hostname of the request using a character rotation, and obfuscate the body of the request using a byte rotation.
Among other problems, this code doesn't work properly because you haven't set oSession.bBufferResponse inside the BeforeRequest handler, which means that the BeforeResponse byte rotation code runs AFTER the proxy has already streamed the complete body to the client.
Your code shouldn't touch the request or response body at all in the case that oSession.HTTPMethodIs("CONNECT")
Your code doesn't have any handlers to emit the Logging messages (as shown in the demo program) which means that it will not notify you of any problems it encounters as it runs.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.